Book Summary-spring Source depth Analysis

Source: Internet
Author: User

The 1th chapter: Spring's overall architecture and environment construction

Spring is layered, mainly divided into network layer, database connection layer, core container layer, AOP layer and test layer.

IOC and Dependency injection are implemented in the core container by Beanfactory. The database connection layer encapsulates JDBC and is compatible with a variety of ORM frameworks.


The 2nd Chapter: the basic realization of the container

Defaultlistablebeanfactory is the core class for loading beans, and xmlbeanfactory inherits this class.

In three steps, first get the XML file validation mode principle, then convert the file into a Document object, and finally parse and register beandefinition.

How does the resource file load? The first definition of the Resource interface encapsulates the underlying resource. Different implementation classes are then encapsulated for resources from different sources. Finally, the resource control is given to Xmlbeandefinitionreader.

Get the XML file validation mode principle? Decide whether to include DOCTYPE, which is the DTD, or XSD.


The 5th chapter: Bean Loading

This chapter takes the interface beanfactory and its implementation class xmlbeanfactory as the core for the source code analysis.

Spring divides circular dependencies into three types: one is the constructor type, which cannot be resolved and can only be thrown beancurrentlyincreationexception. The second is the setter type, which can be solved by exposing the bean in the creation in advance. The third is the "prototype" scope of the bean, which is also not resolved, because spring does not cache "prototype" scope of the bean, the creation of the bean can not be exposed in advance.

A loop-dependent solution? When spring creates a singleton bean, in order to avoid circular dependencies, the bean is objectfactory exposed to the cache and supplied to other beans depending on the completion of its creation.


6th chapter: Container function expansion

This chapter takes the interface ApplicationContext as the core to carry on the source code analysis.


7th chapter: AOP

This chapter takes the principle of AOP implementation as the core for source code analysis.


12th Chapter: Spring Message

The Java Message Service, or JMS, is the Java platform-oriented messaging middleware API for asynchronous communication between program messages.

Spring can implement JMS through the integration of message middleware such as ActiveMQ.

Book Summary-spring Source depth Analysis

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.