ApplicationContext's application Scenario

Source: Internet
Author: User

1. In the previous section we learned about the basic steps of the IOC container setup . After understanding these steps, it is convenient to programmatically manually control the configuration and container creation process .

2. However, in spring, the system has provided a number of well-defined container implementations for the user without the need for developer hands .

3. Compared to the basic IOC containers that simply extend the beanfactory, the ApplicationContext common to developers provides the following additional services for users, in addition to being able to provide the basic functionality of the containers described earlier, which makes it easier for customers to use. So, ApplicationContext is an IOC container of advanced morphological significance .

The 4.ApplicationContext provides new features that are not available in the following beanfactory.

  • support for different sources of information 。 We see applicationcontext expanded messagesource interfaces, these extension of the information source can support internationalization Implementation of the multilingual version of the app provides services.
  • access resources 。 This feature is reflected in the resourceloader and resource Support so that we can from different places get . This abstraction allows the user program to define the bean definition information flexibly, especially from different I/O paths. , but in general, specific applicationcontext are inherit defaultresourceloader subclass. Because defaultresourceloader Yes abstractapplicationcontext The base class for the use of resource in the IOC container, which is explained in detail later.
  • support app events 。 Inherited interface applicationeventpublisher , which in context The event mechanism is introduced. These event and bean life cycle The combination of facilitates the management of the bean.
  • Additional services available in the ApplicationContext . These services make the basic IOC container more versatile. With these rich additions, the use of ApplicationContext is a framework-oriented style of use compared to a simple beanfactory, so it is generally recommended to use it when developing an application. ApplicationContext as the basic form of the IOC container .

ApplicationContext's application Scenario

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.