Stonefishy Blog - by Andrew Shi

Scribbles of a front and back ends developer

Spring AOP - Aspect

An Aspect represent the name of a cross-cutting functionality, it’s only name not implementation.

Let us see the example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class MyLogicClass
{
  public void logicOne() {
      //This is my logic for one.

      //Call Authentication Service 
      //Call Logging Service
      //Call Transcation Service
      //Call Email Service
  }

  public void logicTwo() {
      //This is my logic for two.

      //Call Authentication Service 
      //Call Logging Service
      //Call Transcation Service
      //Call Email Service
  }
}

From above codes, we have four cross-cutting functionalities for logicOne and logicTwo method, So this means we have four Aspects which are Authentication, Logging, Transaction, Email.

Note: Aspect is only denote the name of the cross-cutting functionality, not the implementation