Posts

Showing posts with the label applicationcontext

Differences between BeanFactory and ApplicationContext

Read this article to know what are the differences between BeanFactory and ApplicationContext in Spring Framework. BeanFactory and ApplicationContext interfaces are acts as IOC container. BeanFactory locates in org.springframework.beans.factory package and ApplicationContext locates in org.springframework.context path. ApplicationContext build on top of BeanFactory. So, ApplicationContext will provide the additional functionalities over BeanFactory. Simple integration with Spring AOP, Message Resource Handling (I18N), Event Propagation and application layer specific context(WebApplicationContext) are additional features available with ApplicationContext. Because of these features ApplicationContext is better to use than the BeanFactory. Instantiation of BeanFactory and ApplicationContext: BeanFactory: BeanFactory will use the XmlBeanFactory() class to instantiate. XmlBeanFactory() will use the Resource object to load the bean configuration file. Resource resource = new ...