Dependency Injection

Dependency injection (DI) is a mechanism to employ the inversion of control strategy in a code base. What this means is that reusable components that a particular piece of code requires are dynamically "injected" at runtime.

This allows for a looser coupling between components, and crucially provides an easy mechanism for creating alternate implementations of dependencies.