1

Why is dependency injection a design pattern, while inversion of control and the dependency inversion principle are both not?

They seem to me design patterns, despite their differences.

halfer
  • 19,824
  • 17
  • 99
  • 186
Tim
  • 1
  • 141
  • 372
  • 590
  • [This SO answer](https://stackoverflow.com/questions/3058/what-is-inversion-of-control) seems to be referring to IoC as a design pattern. I think of IoC as the design pattern, and dependency injection as a particular _implementation_ of that design pattern. – Tim Biegeleisen Jun 15 '19 at 01:36
  • Dependency injection is the actual implementation of the IOC architecture. An architecture is a way of putting things. Dependency injection is the implementation that makes the things previously mentioned to interact together. – Nesan Mano Jun 15 '19 at 01:54
  • 3
    Possible duplicate of [What's the difference between design patterns and design principles?](https://stackoverflow.com/questions/31317141/whats-the-difference-between-design-patterns-and-design-principles) – BionicCode Jun 15 '19 at 08:29
  • According to those Wikipedia articles Dependency Injection is not a pattern. It's the name used by Bob Martin in his C++ Report *articles* back in 1994. The DI Principle article you point to though refers to the *SOLID principles*, that's why DI is called a Principle there. – Panagiotis Kanavos Jun 28 '19 at 08:08

0 Answers0