Dependency Injection

Dependency Injection is a pattern for loading services as needed in your code.

Services are classes that abstract module internals and provide an interface for custom modules to use. For example, a database service that allows you to query the database.

These services have their own dependencies, and may need to instantiate an object with config or content loaded from the database before you can use them.

When services are loaded, they are added to the service container where they can be reused by other code.