Dependency Injection


Dependency Injection or Inversion of Controls and some folks call it Hollywood Pattern is intended to reduce coupling between objects.
Simply put: preventing to instantiate an object with different responsibility in one class.
 You can prevent this coupling by 2 ways.
1-by constructor
2-by setter

Comments