The Bean Factory (Beanfactory interface) provides the underlying dependency injection support.
The application context (ApplicationContext interface), built on the bean Factory basis, provides system architecture services.
The ApplicationContext offers more features:
1. Provide text information parsing tools, including support for internationalization (i18n).
2. Provides a common method for loading file resources, such as loading pictures.
3. You can send an event to a bean registered as a listener.
ApplicationContext and Beanfacotry provide more extended functionality, but the main difference is that the latter is deferred loading,
If one of the bean's properties is not injected, the beanfacotry is loaded until the first use of the call Getbean method throws an exception;
ApplicationContext in the initialization itself is a test, so it is helpful to check whether the dependency property is injected;
So we usually choose to use ApplicationContext.
Beanfactory the Basic Factory
Parse, manage, instantiate the interface of all the beans within the container, and all the classes in spring that parse the configuration file implement the interface directly or indirectly
ApplicationContext interface Implements Beanfactory
Features for creating objects:
Beanfactory does not initialize the object when parsing the configuration file, and the object is initialized only when the object is used (Getbean ()).
ApplicationContext initializes all objects in the configuration file when the configuration file is parsed, and the Getbean () method is just the process of getting the object
Beanfactory and ApplicationContext (Bean Factory and application context)