Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多个切面匹配到同一个对象情况 #20

Open
susanbushisan opened this issue Jul 24, 2021 · 4 comments
Open

多个切面匹配到同一个对象情况 #20

susanbushisan opened this issue Jul 24, 2021 · 4 comments

Comments

@susanbushisan
Copy link

如题,在多个切面切到同一个对象的时候,在现有逻辑的情况下无法处理,在org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator#wrapIfNecessary中逻辑匹配到对于的class后然后就返回了代理对象。如果是不支持多切面的话感觉太别扭了,毕竟非常核心的功能

@DerekYRC
Copy link
Owner

为了简化没有考虑多个切面匹配到同一个对象的问题,有空再修复,感兴趣的小伙伴也可以pull request

@DerekYRC
Copy link
Owner

如题,在多个切面切到同一个对象的时候,在现有逻辑的情况下无法处理,在org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator#wrapIfNecessary中逻辑匹配到对于的class后然后就返回了代理对象。如果是不支持多切面的话感觉太别扭了,毕竟非常核心的功能

看了spring源码,如果要支持多个切面,改动较大,会增加复杂度和阅读理解难度,毕竟是用于学习spring源码的的简化版的框架,就不支持此功能了。

@DerekYRC DerekYRC reopened this Nov 24, 2022
@zqczgl
Copy link
Contributor

zqczgl commented Dec 23, 2022

虽然过去一年多了,但如果对多切面感兴趣可以看一下我提交的分支

@DerekYRC
Copy link
Owner

@susanbushisan 多切面增强可查看 @zqczgl 提交的代码,分支lazy-init-and-multi-advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants