Glossary · Phase 7 · Software engineering
Dependency injection
Handing code the things it needs (a database, a model client) instead of letting it create them, so they can be swapped or faked in tests.
Try it now
Each layer only talks to the one below, so you can change either edge without touching the rules.
Learn it properly
Software design · Modules, interfaces and dependencies that keep big programs changeable. About 35 minutes.
Other terms from the same lesson
- design pattern: A named, reusable solution to a common design problem, such as an adapter or a strategy.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.