Aspect-oriented programming (AOP) is an approach to programming that allows global properties of a program to determine how it is compiled into an executable program.
AOP can be used with object-oriented programming ( OOP ).
An aspect is a subprogram that is associated with a specific property of a program.
xxxxxxxxxx
/ Program to shgw PointCuts
@Aspect
class Logging {
// pointcut() is a dummy method
// required to hold @Pointcut annotation
// pointcut() can be used instead of writing line 1
// whenever required, as done in line 4.
// This prevents a repetition of code.
@Pointcut("execution(public void com.aspect.ImplementAspect.aspectCall())") // line 1
public void pointCut()
{
}
// pointcut() is used to avoid repetition of code
@Before("pointcut()")
public void loggingAdvice1()
{
System.out.println("Before advice is executed");
}
}
https://www.geeksforgeeks.org/aspect-oriented-programming-and-aop-in-spring-framework/