11/29/17

BeanFactory vs ApplicationContext

Difference between BeanFactory and ApplicatonContext is:-




Difference between BeanFactory and ApplicationContext are following:
  1. BeanFactory uses lazy initialization but ApplicationContext uses eager initialization. In case of BeanFactory, bean is created when you call getBeans() method, but bean is created upfront in case of ApplicationContext when the ApplicationContext object is created.
  2. BeanFactory doesnt support internatiolization but ApplicationContext supports internationalization.
  3. With BeanFactory annotation based dependency injection is not supported but annotation based dependency injection is supported in ApplicationContext.
  4. BeanFactory explicitly provide a resource object using syntax but ApplicationContext creates and manages resource objects on its own.