Category: container

Dependency Injection is a design pattern in which we write code in a loosely coupled manner. A loosely coupled code is injected at runtime if there is any logic required from that code.

All we need to do is, register our Service Class and Interface in this.

In this way, this service will be injected in that controller context by using the IoC container we created and because we know the controller is initialized at run time, the dependency is also resolved at runtime in a loosely coupled manner.

Means object of one class is not tightly coupled on another object of other class, in spite of this it just hold the reference/functionality of this that is injected with the requesting object at runtime.

Related Articles