Dependency Injection

CLASSDEFINITION.
 DATA(lo_cash_provider) = NEW cl_cash_provider( ).
ENDCLASS

👆🏽 This here is a Dependency

  • Dependency injection is a design pattern in which, instead of creating the object ourselves in our code, we let some other entity create the object and "inject" into our class.
  • ⇒ Dependency injection implements Inversion of Control

The dependency can be injected via:


Children
  1. Backdoor Injection
  2. Constructor Injection
  3. Field Injection
  4. Parameter Injection
  5. Setter Injection

Backlinks