Spring Boot 3 Crash Course Part 7: Aspect Oriented Programming

Ben Meehan
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.

Link to Part 6

Part 8 Now Available : Here

Table of Contents:

  1. Introduction
  2. Aspect-Oriented Programming (AOP)
  3. Why AOP Over Inheritance?
  4. Understanding AOP Pitfalls
  5. Getting Started with AOP in Spring Boot
  6. Terminology Used in AOP
  7. Coding a Simple App
  8. Adding AOP to Our Users App
  9. Pointcuts in More Detail
  10. 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…

--

--

Ben Meehan

Software Engineer at Razorpay. Sharing knowledge and experiences.