What is dependency injection?
What is dependency injection?
Dependency Injection is passing dependency to other objects or framework( dependency injector). Dependency injection makes testing easier. The injection can be done through constructor. SomeClass() has its constructor as following: public SomeClass() { myObject = Factory.getObject(); } Problem: If myObject involves complex tasks such as disk access or network access, it is hard to do unit…
View On WordPress













