Spring AOP - Aspect
Published in:2015-06-05 | Category: Backend
Words: 114 | Reading time: 1min

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

Prev:
Spring AOP - What is AOP?
Next:
Spring AOP - Before Advice