|
Answer» BeanFactory and the ApplicationContext are both JAVA interfaces. The difference is that the ApplicationContext extends the BeanFactory. BeanFactory provides both IoC and DI BASIC features whereas the ApplicationContext provides more advanced features. Following are the differences between these two: | Category | BeanFactory | ApplicationContext |
|---|
| Internationalization (i18n) | Does not provide support for i18n. | Provides support for i18n. |
|---|
| Event Publishing | Provides the ability to PUBLISH events to listener beans by USING ContextStartedEvent and ContextStoppedEvent to publish context when it is started and stopped respectively. | ApplicationContext supports event handling by means of the ApplicationListener interface and ApplicationEvent class. |
|---|
| Implementations | XMLBeanFactory is a popular implementation of BeanFactory. | ClassPathXmlApplicationContext is a popular implementation of ApplicationContext. Also, Java uses WebApplicationContext that extends the interface and adds getServletContext() method. |
|---|
| Autowiring | For autowiring, beans have to be REGISTERED in the AutoWiredBeanPostProcessor API. | Here, XML configuration can be done to achieve autowiring. |
|---|
|