Submitted by admin on

Dependency Injection (DI) is a design pattern/technique that removes dependencies from computer code, making the application easier to maintain and test.

injecting a object into another object i.e. dependency injection

Ways of Injecting dependencies

Dependency Injection can be done in two ways.

  1. Using setter injection
  2. Using constructOr injection

inversion of control vs dependency injection

 

IOC continer: it is a pre defined program, that maintain the object lifecycle(creation, object hold into memory, destroy).

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Standard (Image)