After getting an idea of how Spring manages bean life cycle, next we will learn how Spring provides and maintains the dependencies in your application.
DI is a process of providing the dependent objects to other objects that need it. In Spring, the container supplies the dependencies. The flow of creating and managing the dependencies is inverted from client to container. That is the reason we call it an IoC container.
A Spring IoC container uses the Dependency Injection (DI) mechanism to provide the dependency at runtime. In Chapter 1, Why Dependency Injection?, we saw various DI types such as constructor, setter method, and interface-based. Let's see how we can implement the constructor and setter-based DI through Spring's IoC container.