Skip to main content

Dependency Injection (DI)

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

Restricted HTML

  • You can use shortcode for block builder module. You can visit admin/structure/gavias_blockbuilder and get shortcode, sample [gbb name="page_home_1"].
  • You can use shortcode for block builder module. You can visit admin/structure/gavias_blockbuilder and get shortcode, sample [gbb name="page_home_1"].