The Spring IoC container lies at the core of the Spring Framework. The container uses Dependency Injection for managing various Spring application components. The IoC container is responsible for creating the objects, configuring them, wiring them together, and managing their lifecycle. The container receives instructions about the same from the provided configuration metadata. Means for providing the configuration metadata can include Java annotations, Java code, or XML. There are two types of IoC containers in Spring:
ApplicationContext – Provides additional functionality. It is built on top of the BeanFactory interface.
BeanFactory – A prepackaged class containing a collection of beans. Instantiates the bean whenever as required by the clients