Index Ai Academy
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.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write