Wednesday, September 9, 2015

Dependency Injection

Dependency Injection is all about injecting dependency.
Here, dependency indicates an object that can be used (a service) and injection means passing of dependency to a dependent object (a client).
Dependency Injection is based on software design pattern. Passing the service to client rather than allowing a client to build or find the service is the fundamental requirement of this pattern.
So we can say that dependency injection is the process of removing the dependency of object which creates the independent business objects. In other term, we can say that the process of injecting (converting) coupled (dependent) object into decoupled (independent) object is termed as dependency injection.
There are various types of Dependency Injection which are mentioned below
1. Constructor Injection
2. Setter Injection
3. Interface injection

4. Service Locator Injection

No comments:

Copyright © Codingnodes,2014.All Rights Reserved.