Aspect Oriented Programming with Spring and AspectJ
· 8 min read
Aspect-Oriented Programming (AOP) powerfully complements Object-Oriented Programming (OOP) by providing another way of thinking about program structure.
Drawing a comparison between AOP and OOP we can say that the key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. With aspects, you can group application behaviour that was once spread throughout your applications into reusable modules. You can then declare exactly where and how this behaviour is applied. This reduces code duplication and lets your classes focus on their main functionality.