Software Engineering ยท Architecture
Supplying an object's dependencies from the outside instead of having it construct them itself, so those dependencies are easy to swap or mock.
Mental model: Like passing an Engine into a Car instead of having the Car build its own โ you can swap engines later.
Example: A service that receives a Logger through its constructor instead of instantiating one internally, so tests can inject a mock logger.
In practice: Frameworks like Spring, Angular, and NestJS implement this via a container that resolves and injects dependencies automatically by type, instead of requiring manual wiring everywhere.