Tuesday, December 2, 2014

Dependency Injection ( and Dependency Injection Container)

Video : http://www.youtube.com/watch?v=IKD2-MAkXyQ

Dependency : Dependency is has a relationship. Class A has class B. Class Cycle has Tyre.

Injecting Dependency : Dependency is pushed from outside to the class. So in above example Class Cycle instead of instantiating instance of class Tyre, gets an instance of Tyre from outside.

Principal Behind Dependency Injection : We should code to abstractions (interfaces).

Dependency Injection Container Pattern : Used to create dependencies for class\es.  Knows which class has which dependencies and how to instantiate those dependencies.


No comments:

Post a Comment