Spring Boot 3 Crash Course Part 7: Aspect Oriented Programming
10 min readMar 9, 2024
Aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. In simpler terms, instead of adding the code for logging into the class method itself, we will separate it. Think of it like the layers of an onion.
Part 8 Now Available : Here
Table of Contents:
- Introduction
- Aspect-Oriented Programming (AOP)
- Why AOP Over Inheritance?
- Understanding AOP Pitfalls
- Getting Started with AOP in Spring Boot
- Terminology Used in AOP
- Coding a Simple App
- Adding AOP to Our Users App
- Pointcuts in More Detail
- Conclusion
Pre-requisites:
Good grasp of Spring and Spring Boot basics
What is an Aspect?
An aspect is just a particular behaviour that needs to be present in all layers of your application. For example, a typical web application might have a web, business and data layers. Logging needs to be present for all these…