Dependency injection refers to a technique for building objects in an object oriented language. The idea of this technique is to abstract the process of creating an object from clients of these objects.
There are four roles in dependency injection:
Client- This is an object that needs to use other objects to achieve a task
Interface- The client doesn’t know which objects it receives, it interacts with those objects only through a known
Service- An object that implements an
interface. This object is passed to the
Injector- An object that takes care of constructing objects and passing them to