First, dependency injection is basically three ways:
1, the first is the setter injection, it can be understood to assign a value to the property of the interface type in the customer class, call different service types according to the actual type of the property, which may use the policy mode;
2, through the constructor for the client class interface type attribute assignment, according to the actual type of the property call different service types;
3, through configurable to set the dynamic invocation of different service types, that is, dependency acquisition, which may be used in the abstract factory;
In fact, the above three are used in OO polymorphism, so you have to use dependency injection, which eliminates the duplication of code, and in line with the OCP principle, although may sometimes be more code, but improved maintainability, hierarchical structure is also clear.
About dependency Injection a better piece of blog post share: http://www.cnblogs.com/leoo2sk/archive/2009/06/17/1504693.html
Dependency Injection Summary