Below mentioned are some of the advantages of using Dependency Injection.
1) Loosely coupled systems can be developed using Dependency Injection.
2) As long as the component implements the interface type, it is easy to swap in a different implementation of a component.
3) The main advantage of this Dependency Injection is that, it allows the objects to be mocked with in the Unit Tests.
Asked In: Many Interviews |