Konubinix' opinionated web of thoughts

Dependency Injection

Fleeting

dependency injection

More generic than IoC container. It only means that the one that uses the implementation only thinks using more abstract concepts. It is the use of polymorphism in algorithms.

dependency injection is a design pattern in which an object or function receives other objects or functions that it depends on

https://en.wikipedia.org/wiki/Dependency_injection

dependency injection aims to separate the concerns of constructing objects and using them, leading to loosely coupled programs

https://en.wikipedia.org/wiki/Dependency_injection

Fundamentally, dependency injection consists of passing parameters to a method

https://en.wikipedia.org/wiki/Dependency_injection

Because the client does not build or find the service itself, it typically only needs to declare the interfaces of the services it uses, rather than their concrete implementations

https://en.wikipedia.org/wiki/Dependency_injection

example of inversion of control without dependency injection is the template method pattern, where polymorphism is achieved through subclassing

https://en.wikipedia.org/wiki/Dependency_injection

example of inversion of control without dependency injection is the template method pattern, where polymorphism is achieved through subclassing. In contrast, dependency injection implements inversion of control through composition, and is often similar to the strategy pattern. A difference is that the strategy pattern is intended for dependencies that are interchangeable throughout an object’s lifetime, whereas with dependency injection typically only a single instance of a dependency is used.

https://en.wikipedia.org/wiki/Dependency_injection

The pattern ensures that an object or function which wants to use a given service should not have to know how to construct those services

https://en.wikipedia.org/wiki/Dependency_injection

Notes linking here