Skip to content

Glossary: Software Design Patterns in Rust

Dependency injection

Also written: DI, injection

Giving code its dependencies from outside instead of letting it create or find them. That lets tests pass in fakes, so OrderLog can run without disk or the real clock.

Where the book teaches it

Related terms

Constructor injectionComposition rootService locatorFake