8 Aspect-Oriented Programming with Spring

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Getting started with AOP with Spring
  • Becoming familiar with types of advices
  • Defining point-cut designators
  • Capitalizing on the power of annotations
  • Blending AspectJ with Spring
  • Configuring Spring AOP with annotations

With the dawn of object-oriented programming (OOP), software systems started to be represented as a collection of discrete classes with each class defined with a clearly stated task. This paradigm had replaced the procedural approach of programming, but it also introduced shortages on parts like cross-cutting abilities where a feature can affect most parts of a system. The most prominent example of this might be a logging facility where detailed information for each method execution is logged for auditing, or you can think of exception handling where errors that occur across the layers of the application are handled at a single point and applicable measures are immediately taken to address the issues. One last example that we can give is the Declarative Transaction Management, which allows us to make the transaction configuration in a non-obtrusive way without doing any coding for each code part that has an access to the database. Of course, ...

Get Beginning Spring 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.