Table of contents
foreword
I have never advocated [through the source code] to understand the business, because everyone's ability is limited, and there may even be deviations in understanding due to reading errors, so I decided to help everyone [open the eyes] first, and first look at the flow chart as a whole , It’s good to know what Spring did in the process of writing source code.
reading guide
For [1. The simple flow chart speculated before], you can ignore it. This is just a flow chart that I reversed based on the basic functions of Spring during the bootstrap phase. but,You must read [2. Bean life cycle flow chart] and [3. Stage source code flow chart], which is the focus of this chapter.
flow chart
1. The simple flow chart of the previous speculation (a little reference)
In my previous notes, in the process of learning, I summarized some flow charts myself, and I attach them here for you to compare. Everyone just needs to know it simply, with a little reference.
Spring overall simple flow chart:
Spring scan simple flow chart:
SpringIOC simple flow chart:
*2. Bean life cycle flow chart (according to Spring source code self-conclusion)
The picture below shows the Bean life cycle that I self-assembled based on the Spring source code, but the AOP process was not intercepted. When I learn later, I will update it when I have a clue. But in general, this flow chart is perfect
*3. Stage source code flow chart (continuously updated)
Phase 1: Scan to generate BeanDefinition
Phase 2 (1): Instantiation
Phase 2: (2) Attribute Filling [Looking for Injection Point]
Phase 2: (2) Attribute Filling [Attribute Filling]
Phase 4: Bean Destruction (Flowchart of registration and destruction of Bean)