What are the core features of spring? What are the core reasons for using the spring framework?

Source: Internet
Author: User

What is the core function of quote:spring? What are the core reasons for using the spring framework? (IT company interview Manual, can see more)

There are three core components in the Spring framework: Core, Context, and Beans. One of the core components is beans, and spring provides the core function of Bean Factory.

one of the core issues that spring solves is the transition of dependency between objects into a configuration file , which is spring's dependency injection mechanism. This injection mechanism is managed in the IOC container.

The Bean component is under Spring's Org.springframework.beans package. This package mainly solves the following functions: Bean definition, bean creation, and parsing of the bean. The only thing that matters to spring users is the creation of beans, and the other two are done by the spring internal mechanism. The Spring Bean was created using a typical factory model, and his top-level interface was beanfactory.

Beanfactory has three subcategories: Listablebeanfactory, Hierarchicalbeanfactory, and Autowirecapablebeanfactory. But from this we can find that the final default implementation class is Defaultlistablebeanfactory, and he implements all the interfaces. So why define so many levels of interfaces? Refer to the source code and description of these interfaces found that each interface has his use of the occasion, it is mainly to distinguish between Spring in the process of the object during the transfer and conversion process, the object of the data access restrictions. For example, the Listablebeanfactory interface indicates that these beans are a list, and hierarchicalbeanfactory indicates that the beans are inherited, that is, each bean may have a parent bean. The Autowirecapablebeanfactory interface defines the automatic assembly rules for the Bean. These four interfaces collectively define the collection of beans, the relationships between beans, and the bean behavior.

The Bean definition is a complete description of all the information in the <bean/> node that you define in the Spring configuration file, including the various child nodes. When spring successfully parses a <bean/> node that you define, within spring, he is transformed into a Beandefinition object. All subsequent operations are done on this object. The parsing process of the Bean is very complex and the function is very thin, because there are many places that need to be expanded, and there must be sufficient flexibility to cope with possible changes. The parsing of the Bean is mainly the parsing of the Spring configuration file.

What are the core features of spring? What are the core reasons for using the spring framework?

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.