Spring source code interpretation - environment construction

I have nothing to do recently, and the technology always feels stuck and cannot make breakthroughs. Everyone says that the best way to learn programming is to learn and learn from other people's experience, because I have the urge to learn the source code, and I hope to take this to a higher level of technology. Spring is a widely used open source framework in the java system, so the first source code reading is going to start with Spring, and record the bits and pieces to deepen its understanding.

    I am purely technical, and my writing is not very good. If there is any misunderstanding, please correct me.

    Closer to home, of course, the first step in learning the source code is to set up the source code environment. The environment I use is idea2016+windows7.

    The first step is to download the Spring source code: The Spring source code has been moved to github. The latest version is 5.0.0.M1, and the latest release version is v4.3.2.RELEASE. In this article, v4.3.0.RELEASE is used, and the source code address is:

    https://github.com/spring-projects/spring-framework/releases/tag/v4.3.0.RELEASE , directly download the zip package and extract it to the directory you specify.

    The second step is to build the spring source code. Spring has already used gradle for project dependency management. You may download gradle to configure and build, and gradle will be yours.

    The third step is to import the source code into the idea, directly open the decompression target, and select use default gradle wrapper. This process will take a long time because it needs to download dependencies.

 

The Spring source code is relatively large and adopts a modular management method. The overall architecture of Spring is as follows:

 

Figure 1.1 Spring runtime architecture

The bottom layer is the Test framework, which is used to test the Spring framework, followed by the Core Container (core container), which is the foundation of the Spring framework, providing IOC and DI functions and other additional functions. Let's start with the core Core and Beans modules first, so I only imported two modules, spring-beans and spring-core, compiled, no errors were reported, OK, and the environment was successfully prepared.

In the next section, we will start with the most basic IOC container, and conduct the source code research of Spring IOC step by step. It is the first time to write notes, please give me some pointers on the shortcomings, thank you!

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326734150&siteId=291194637