AOP Terminology
In general, AOP will use the following terminologies in order to implement AOP based implementation.
- Aspect
- Advice
- Join point
- Pointcut
- Target
- Proxy
- Weaving
- Introduction
1. Aspect
An Aspect is the concern or a service which we want to implement in the application such as logging, transactional , Security etc.
2. Advice
An Advice is the actual implementation of the aspect. Aspect is a concept and Advice is the concrete implementation of the concept.
3. Join point
A JoinPoint is a point in the execution of the program where an aspect can be applied. It could be before/after executing the method, before throwing an exception, before/after modifying an instance variable etc.
4. Pointcut
PointCuts tell on which join points the aspect will be applied. An advice is associated with a point cut expression and is applied to a join point which matches the point cut expression.
5. Target
Target is a business component class which is being advised.
6. Proxy
Proxy is the object which is created by the framework after applying the advice on the target object.
Proxy = target + advice(s)
7. Weaving
Weaving is the process of applying the aspect on the target object to product the proxy object. Weaving can be done at compile time, class loading time or runtime. Spring AOP supports weaving at runtime.
8. Introduction
An Introduction allows adding new methods or attributes to existing classes. The new method and instance variable can be introduced to existing classes without having to change them, giving them new state and behavior.