Spring Framework

ApplicationContext and BeanFactory

  1. 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

  1. The instantiation of the ApplicationContext creates the container that consists of the objects defined in that XML file.
    1. The purpose of this XML file is to create the beans and their relationship.
  2. The Spring container is simply a holder of the bean instances that were created from the XML file.
  3. An API (getBean) is provided to query these beans and use them accordingly from our client application.

ApplicationContext vs BeanFactory

CriteriaApplicationContextBeanFactory
I18NApplication contexts resolve text messages, including support for internationalization (I18N)NO support
Generic way to load file e.g imagesApplication 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.
Spring Wiring

Spring Bean Life cycle

Published by

Unknown's avatar

sevanand yadav

software engineer working as web developer having specialization in spring MVC with mysql,hibernate

Leave a comment