1 min readDec 26, 2023
Aspect Oriented Programming terminologies you should be familiar with
- Aspect: An aspect is a modular unit that encapsulates cross-cutting concerns in a program. Cross-cutting concerns are functionalities that affect multiple parts of the codebase. Class having cross cutting concerns is denoted with @Aspect notation
- Advice: Advice is the code that gets executed when a certain point in the program is reached. It represents the behavior associated with a cross-cutting concern. These are the actual actions which are executed on join points based on type of advices. AspectJ supports five types of advice annotations: @Before, @After, @AfterReturning, @After Throwing, @Around.
- Join Point: A join point can be a point during the execution of a program, such as the execution of a method or the handling of an exception. A call to a method is a join point, and so is a field access. Join points are where advice can be applied.
- Point Cut: A pointcut is a set of join points. A pointcut is a predicate that matches join points. Advice is associated with a pointcut expression and runs at any join point matched by the pointcut. E.g. @Pointcut(“execution(* transfer(..))”) // the pointcut expression