Google News
logo
Full Stack Developer - Interview Questions
Explain dependency injection.
The Dependency Injection (DI) pattern is a design pattern for implementing the Inversion of Control (IoC). Dependent objects can be created outside of classes and made available to classes in different ways. Three types of classes are involved in Dependency Injection as follows :
 
Client Class : It depends on the service class.

Service Class : It provides service to the client class.

Injector Class : It injects service class objects into the client class.
Advertisement