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