Inversion of control
Inversion of control is the design principle that a component should not control the flow of its dependencies — instead, the framework or container controls flow and passes resources to the component when needed. Dependency injection is one form of IoC; event-driven callbacks and aspect-oriented programming are others.
The 'Hollywood Principle' (don't call us, we'll call you) is shorthand for IoC. In a non-IoC design, a component fetches what it needs and calls dependencies directly; in an IoC design, the component declares what it needs and lets the framework deliver it. The benefit is loose coupling and testability; the cost is a shallower stack trace and harder learning curve (the actual call path lives in framework config, not source code). Most modern application frameworks (Spring, Angular, NestJS, ASP.NET Core) build IoC in at the foundation; the question for a designer is rarely 'IoC or not' but 'how aggressively to lean on it'.
Related terms
- Dependency injection
Dependency injection is the design pattern where a component receives its dependencies as parameters rather than constructing them internally.
- Hexagonal architecture
Hexagonal architecture (also called ports and adapters), introduced by Alistair Cockburn in 2005, structures an application so the core domain logic depends only on abstract 'ports' — and concrete adapters (web framework, database, message bus) plug into those ports from outside.
- Event-driven architecture
Event-driven architecture is the design pattern where services communicate by emitting and consuming events rather than by direct synchronous calls.