Inversion of control (IoC)

Inversion of control (IoC) is a design principle in which the control flow of a program is somehow inverted.

In traditional programming, the main program is in control of the flow of the program. In IoC, the flow is inverted, and the control is given to a framework or runtime environment. The Spring Framework is a well-known IoC container for Java applications.

Various design patterns can be used to implement IoC, such as the dependency injection and publish-subscribe patterns. Dependency inversion is one principle that IoC puts into practice by inverting the direction of dependencies between modules.