Dependency Injection
Let the framework wire object dependencies instead of constructing them by hand — for testability and loose coupling.
Dependency Injection is the idea at the heart of Spring: instead of a class constructing the collaborators it needs with new, those collaborators are supplied to it from outside. Hard-coded construction welds a class to specific implementations and makes it nearly impossible to test in isolation, because you cannot swap a real database or HTTP client for a fake. DI inverts the control of creation — hence "Inversion of Control" — so the framework, not the class, decides what concrete dependency to hand over.
Instead of a chef growing their own vegetables, the kitchen receives them from a supplier. Swap suppliers without changing the recipe.