Spring IoC containerSpring IoC container is responsible to manage the life cycle of a bean. The container handles how the objects should be created. We can also tell it how different objects are dependent on each other. The Spring IoC container is responsible to provide the objects as required by the application.
We have to provide the metadata configuration to the container. Spring IoC container reads the metadata configuration on how objects should be created and how they are dependent on each other. Then it starts creating the beans.
The org.springframework.beans and org.springframework.context are the two packages which are the basic building blocks of Spring’s IoC container.
BeanFactory and ApplicationContext
BeanFactory and ApplicationContext are the interfaces provided by the spring core packages. ApplicationContext is the sub-interface of BeanFactory. However, ApplicationContext is much more specific. It provides additional features such as AOP, message resource handling, event publication and application layer specific context such as WebApplicationContext.
The interface org.springframework.context.ApplicationContext is responsible for managing object’s instantiating, configuration and initialization. The information on how the different objects should be created is given by configuration metadata.