Skip to content

Glossary: Software Design Patterns in C++

Dependency injection

Also written: DI, injection, inject

Giving code its dependencies from outside instead of letting it find or make them. Tests can then pass in fakes, so they need no disk or clock.

Where the book teaches it

Related terms

Constructor injectionComposition rootService locatorFake