Spring框架原理概述

我当前的目标是学习 Spring 源码,试图理解 Spring Framework 的运行机制、原理与实现。
我目前用到的技术是公司基于 Spring boot 进行封装的框架。这次就聚焦于 Spring Framework 最核心的内容,也就是 IoC 和 AOP 。

一、跟踪源码着手点:

1、BeanFactory 分析:new XmlBeanFactory(new ClassPathResource("xxx.xml"));

2、bean 实例化分析:AbstractBeanFactory 类的 getBean("xxx") 方法;

3、ApplicationContext 分析:new ClassPathXmlApplicationContext("xxx.xml");

4、过程中涉及到:Resource、BeanFactoryPostProcessor、BeanPostProcessor、Message、Event和Listener、LifeCycle 等,另行跟踪分析

二、开始表述细节:

1、IoC的原理:https://www.cnblogs.com/bsyt/p/13283543.html

2、Spring容器的原理:https://www.cnblogs.com/bsyt/p/13283637.html

3、BeanFactory的启动流程:https://www.cnblogs.com/bsyt/p/13283927.html

4、Bean的加载过程:

5、ApplicationContext的启动流程:

6、Bean的循环依赖:

7、AOP的原理:

8、Spring AOP的实现:

9、BeanFactoryPostProcessor 和 BeanPostProcessor

10、Event 事件原理

11、Message 国际化原理

12、Resource 统一资源处理

13、区别于BeanFactory的FactoryBean

14、持续更新......

三、写在最后

1、源码环境搭建:https://www.cnblogs.com/bsyt/p/13297223.html

在准备分享PPT的时候,临时回顾了下内容动手写下来,不是很全面和详细,后续这些文章都会进行修改和补充。

参考资料,包括:《Spring Farmework Doucument》、Spring Framework 5.1.3源码、《Spring源码深度解析》《Spring揭秘》

观众老爷们点个赞!

原文地址:https://www.cnblogs.com/bsyt/p/13162588.html