Inversion of Control
Inversion of Control (IoC) is a design principle from software engineering. Instead of your application directly managing dependencies or execution orders, those responsibilities are delegated elsewhere — typically to a framework that knows when and how to invoke your code. This decouples your application logic from the system orchestrating it, making your code more modular and extensible. For example, if you build a store application that handles inventory and billing, instead of hard-wiring the payment provider, let the user define which one they want to use. At any time, it becomes easy to plug in a new payment processor without changing the core logic. The Hollywood Principle: “Don’t call us, we’ll call you” is a good analogy of IoC. One common way to implement IoC is through Dependency Injection (DI), where components receive their dependencies from an external source rather than creating them.