Spring AOP enables Aspect-Oriented Programming in spring applications.
In AOP, aspects enable the modularization of concerns such as transaction management, logging or security that cut across multiple types and objects (often termed crosscutting concerns).
AOP provides the way to dynamically add the cross-cutting concern before, after or around the actual logic using simple pluggable configurations.
It makes easy to maintain code in the present and future as well. You can add/remove concerns without recompiling complete sourcecode simply by changing configuration files (if you are applying aspects suing XML configuration).
AOP implementations are provided by:
3. JBoss AOP
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency>
Spring AOP Implementation
@EnableAspectJAutoProxy(proxyTargetClass = true)
Fundamentals
execution(* com.sagarandcompany.EmployeeManager.*(..))
execution(* EmployeeManager.*(..))
execution(public * EmployeeManager.*(..))
execution(public EmployeeDTO EmployeeManager.*(..))
execution(public EmployeeDTO EmployeeManager.*(EmployeeDTO, ..))
execution(public EmployeeDTO EmployeeManager.*(EmployeeDTO, Integer))