ApplicationContext and BeanFactory
- The BeanFactory interface provides an advanced configuration mechanism capable of managing any type of object.
- ApplicationContext is a sub-interface of BeanFactory. It adds easier integration with Spring’s AOP features
ApplicationContext
- The instantiation of the ApplicationContext creates the container that consists of the objects defined in that XML file.
- The purpose of this XML file is to create the beans and their relationship.
- The Spring container is simply a holder of the bean instances that were created from the XML file.
- An API (getBean) is provided to query these beans and use them accordingly from our client application.
ApplicationContext vs BeanFactory
| Criteria | ApplicationContext | BeanFactory |
|---|---|---|
| I18N | Application contexts resolve text messages, including support for internationalization (I18N) | NO support |
| Generic way to load file e.g images | Application contexts provide a generic way to load file resources, such as images. | NO support |
| Application contexts can publish events to beans that are registered as listeners. | ||

