I blog at bugstack.cn
Precipitate, share, grow, let oneself and others can have a harvest! 😄
First, why write Spring
Spring, who lives with us day and night, is just like your daughter-in-law who sleeps beside you. You know to ask her for food, drink, pocket money and skin. But you don’t know how much grain is stored in her warehouse, or whether she’s buying money or saving it in the bank. Just kidding. I’m gonna get serious now!
Why Spring every day to use, but want to go to read the source code, how so difficult! Because the Spring framework, created in 2002 by Rod Johnson, an expert in Java and J2EE development, has grown in size as JDK versions and market needs have evolved.
When you read the source code you get the feeling:
- Why does the code jump around like it’s not writing your own code
pure
- Why is it that so many interfaces and interface inheritance, class A inherits from class B that also implements interface X implemented by class A
- Simple factory, factory method, proxy pattern, observer pattern, how can there be so many design patterns used
- Resource loading, application context, IOC, AOP, and the Bean declaration cycle run through, where the piece of code starts
If only fragmentary back point is not a system of Spring knowledge, you want to draw a complete Spring Bean object life cycle is difficult!It took me three months to fully understand the life cycle of Spring Beans.Know how to scan for load objects
,Define BeanDefintion
,Property placeholder
,BeanFacePost provides a mechanism for modifying the BeanDefintion property prior to Bean object instantiation
,Bean objects are instantiated in JDK and Cglib
,Aware Sensing interface
,BeanPostProcessor performs pre - and post-processing when the object is initialized
,Object scope
,The VIRTUAL machine registers the hook for destruction
Wait, LET me put them together in a picture like this:In my summary of this information, is to learn the Spring source code for the purpose of writing a simplified version of the Spring frameworksmall-springTo understand the core principles of Spring. In the process of handwriting will simplify the Spring source code, extract the core logic in the overall framework, simplify the code implementation process, retain the core functions, such as IOC, AOP, Bean lifecycle, context, scope, resource processing and other content implementation.
Participate in small-Spring together
With 3 months of time, sort out a set of simplified version of the Spring source code, but also the corresponding to each step of the implementation of the article, introduced the design ideas, implementation process and knowledge of the extension, I hope this information can also help you become a “proficient” Spring, At least you can read the Spring source code with less effort!
Small-spring:github.com/fuzhengwei/… Reader communication: In the process of learning, if you encounter any problems, please submit an issue to me
Hello, World of Spring! Hello, Spring world!
Welcome here. I’m glad you got the book. If you read every chapter of the book, it will not only help you in your job interview, but also help you learn more about Spring’s core technologies.
This warehouse for the purpose of learning Spring source code, by writing a simplified version of the Spring framework, understand the core principles of Spring.
In the process of handwriting will simplify the Spring source code, extract the core logic in the overall framework, simplify the code implementation process, retain the core functions, such as IOC, AOP, Bean lifecycle, context, scope, resource processing and other content implementation.
Little Fuge, the reason why began to lui Spring source code, mainly because in the preparation of the “face of the manual”, involving the Spring source code will write a lot of text description, drawing lengthy process drawings, do a lot of content foreshadowing, but for new people want to directly learn this part of the content is still very difficult, So now in order to let me and more partners can have a grasp of learning, let’s study together what is happy planet!
-
This column is actual coding materials, in the process of learning, we need to combine the objectives to be solved in each chapter of the paper, the design of ideas, into the practical coding process. While learning the code, it is also a good idea to understand why this part of the implementation is the way it is, what design patterns are used, and what means are used to do what separation of responsibilities. Only through such learning can we better understand and master the implementation process of Spring source code, but also can help you in the future in-depth learning and practical application of the process to lay a solid foundation.
-
In addition, the content of this column is combined with the design pattern, which corresponds to the design and development of SpringBoot middleware. Therefore, readers can browse the relevant materials if they don’t understand the design pattern during the learning process, and can also practice with the content of middleware after learning Spring.
-
Source code: the source code involved in this column has all been integrated into the current project, and can be matched with the corresponding case source code in the chapter. You can get a complete set of projects to run directly, you can also open each chapter corresponding to the source code project to run separately.
-
If you encounter any problems in the process of learning, including: cannot run, optimization opinions, text errors and any other problems can be submitted to the issue, can also contact the author: Little Fuge’s wechat, Fustack
-
Each section of the column provides clear design drawings and corresponding class diagrams, so it’s important not just to learn how the code was written, but to understand where the content came from.
Three, collect and sort out my study materials
📚 Code repository: github.com/fuzhengwei/…
Container: IOC
- Chapter 01: Introduction
- Chapter 02: Creating a simple Bean container
- Chapter 03: Implement the definition, registration, and acquisition of beans
- Chapter 04: Object instantiation policy
- Chapter 05: Injecting properties and dependent objects
- Chapter 06: Resource loader resolves file registration objects
- Chapter 07: Application context
- Chapter 08: Initialization and destruction methods
- Chapter 09: Aware of container objects
- Chapter 10: Object scope and FactoryBeans
- Chapter 11: Container events and Event Listeners
Proxy: AOP
- Chapter 12: Implement AOP aspect based on JDK and CGlib
- Chapter 13: Extending AOP to the Bean lifecycle
- Chapter 14: Automatically scanning Bean object registrations
- Chapter 15: Injecting property information through annotations
- Chapter 16: Setting property injection for proxy objects
Advanced part: Design
- Chapter 17: Level 3 caching deals with cyclic dependencies
- Chapter 18: Data type conversion
Four, 🎉 ending
Heart world, sensual dog "code". Life is warm, hidden in common!
Little Fuge has been fumbling along this road for more than two years, from no fan base, no writing experience, no technical article precipitation, of course, there is no operation skills, step by step to meet a lot of fans partner support, the concern of the main friends, platform operation help, Slowly grew into a stubborn technology saplings!
Over the past two years, I have written 8 special topics, 22 categories, 255 + articles! And on April 23, 2021, at the Book Festival, my first technical book, Relearning Java Design Patterns, was published. Not long after, I’ve seen books hit the top of the sales charts, seen my technical books in the library, been bought by a fellow foreign fan and taken out of the country, and seen a girl buy them as a gift for her boyfriend. Also soon to see baidu encyclopedia and my book information, is really very happy, but not expansive!
Also wish everyone, can insist on going on in their own way, long-term precipitation is bound to harvest what you want on the journey of the fruit.