AOP – problem solver

We have seen in the preceding section that with OOP, code tangling and scattering occurs. With AOP, we can achieve the following objectives/benefits:

  • Modularizing crosscutting concerns
  • Decoupling of modules
  • Removing crosscutting concerns regarding module dependency

Spring AOP allows us to keep our crosscutting concerns logic separate from our business logic so we can focus on our application's main logic. To help us perform this separation, Spring provides Aspects, a normal class where we would implement our crosscutting concerns logic. Spring provides ways to inject these Aspects into the right place in our application without mixing them with business logic. We will see more about Aspects, how to implement it, and how to apply it in the following sections.

This diagram illustrates Spring AOP:

How AOP solves code tangling
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset