Middle
What is the difference between advice and point in aspects?
sobes.tech AI
Answer from AI
- Advice - this is the code that executes at a specific point during the program's execution (pointcut). It defines what exactly should happen (for example, logging, transaction auditing) at that point.
- Pointcut (not "point") - this is a set of points in the program's execution where advice can be applied. It determines WHERE exactly the advice should be executed, using special expressions to match method signatures, constructor calls, exception handling, etc.
Thus, a pointcut defines a set of join points, and advice is the action performed at these points.