What is the difference between advisor and aspect in Java – AOP?

I'm new to spring AOP Based on my understanding, I have noticed that both Advisor (such as defaultpointcutadvisor) and aspect (such as classes annotated with @ aspect) can help solve cross cutting problems by doing more when calling methods

What is the difference between the two semesters?

Solution

Advice is the way you take action on pointcut You can use it before, after, or even around the suggestion to apply any action you define When it comes to spring aspect, it is just a high-level class and combines two concepts: union point and suggestion It can be done through XML - based blueprints or programmatically In addition, you should specify the point to insert the aspect, using jointpoint

Spring aspects and advice cannot replace each other, because aspects is just a combination of joint points and suggestions

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>