DI and IoC

Dependency Injection and Inversion of Control

CORE.Drop uses Dependency Injection (DI) and Inversion of Control (IoC) to manage implementations and abstractions.

DI and IoC have many advantages. A good summary can be found here

The specific implementation used in CORE.Drop is Windsor Castle. For a summary, check out the first answer in this stack overflow thread

Roughly how it works in CORE.Drop:

  • When the application is started an IoC container is created. It installs all implementations and interfaces from its dependencies

  • Throughout the application, the container is used to instantiate objects without specifying implementations (the container already knows)

  • The new keyword should be avoided (creates a tight coupling between interface and implementation)

Last updated