[Spring topic] Bean life cycle flow chart (unfinished - continuous update)

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:
insert image description here
Spring scan simple flow chart:
insert image description here
SpringIOC simple flow chart:
insert image description here

*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
insert image description here

*3. Stage source code flow chart (continuously updated)

Phase 1: Scan to generate BeanDefinition
insert image description here
Phase 2 (1): Instantiation insert image description here
Phase 2: (2) Attribute Filling [Looking for Injection Point]
insert image description here
Phase 2: (2) Attribute Filling [Attribute Filling]
insert image description here

Phase 4: Bean Destruction (Flowchart of registration and destruction of Bean)
insert image description here

Guess you like

Origin blog.csdn.net/qq_32681589/article/details/132237714