1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-07-28 12:22:17 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Guide哥
473e87ea06
Merge pull request #1624 from Jarvan-Song/patch-4
Update spring-design-patterns-summary.md
2022-03-17 12:39:24 +08:00
Jarvan-Song
cb1f7e6e6a
Update spring-design-patterns-summary.md 2022-03-16 16:09:16 +08:00

View File

@ -115,7 +115,7 @@ public Object getSingleton(String beanName, ObjectFactory<?> singletonFactory) {
AOP(Aspect-Oriented Programming:面向切面编程)能够将那些与业务无关,**却为业务模块所共同调用的逻辑或责任(例如事务处理、日志管理、权限控制等)封装起来**,便于**减少系统的重复代码****降低模块间的耦合度**,并**有利于未来的可拓展性和可维护性**。
**Spring AOP 就是基于动态代理的**如果要代理的对象实现了某个接口那么Spring AOP会使用**JDK Proxy**,去创建代理对象,而对于没有实现接口的对象,就无法使用 JDK Proxy 去进行代理了这时候Spring AOP会使用**Cglib** 这时候Spring AOP会使用 **Cglib** 生成一个被代理对象的子类来作为代理,如下图所示:
**Spring AOP 就是基于动态代理的**如果要代理的对象实现了某个接口那么Spring AOP会使用**JDK Proxy**,去创建代理对象,而对于没有实现接口的对象,就无法使用 JDK Proxy 去进行代理了这时候Spring AOP会使用 **Cglib** 生成一个被代理对象的子类来作为代理,如下图所示:
![SpringAOPProcess](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-6/SpringAOPProcess.jpg)