© Adam L. Davis 2020
A. L. DavisSpring Quick Reference Guidehttps://doi.org/10.1007/978-1-4842-6144-6_5

5. Spring AOP

Adam L. Davis1 
(1)
Oviedo, FL, USA
 

AOP stands for aspect-oriented programming. AOP allows you to address cross-cutting concerns, such as logging, transaction management, security, and caching, without repeating the same code over and over. It allows you to apply the DRY (Do not Repeat Yourself) principle.

Spring uses AOP itself in many ways, but also directly exposes the tooling to developers.

In short, you use Spring AOP by defining a pointcut (where to add additional features) and advice (the feature you are adding).

Spring creates two types of proxies, either JDK1 (when implementing an interface, this is built-in to the JDK) or

Get Spring Quick Reference Guide: A Pocket Handbook for Spring Framework, Spring Boot, and More now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.