WebGlossary.info
Dependency injection
- A technique whereby one object supplies the dependencies of another object. A “dependency” is an object that can be used, for example as a service. Instead of a client specifying which service it will use, something tells the client what service to use. The “injection” refers to the passing of a dependency (a service) into the object (a client) that would use it. The service is made part of the client’s state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern. The intent behind dependency injection is to achieve separation of concerns of construction and use of objects. This can increase readability and code reuse. ← Wikipedia
- Previous term: Dependency
- Next term: Dependency Inversion Principle
- Random term: Hashbang