O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Spring AOP with Spring IoC: An example

In Chapter 10, we wrote a notification service that notifies the system administrator whenever a fatal error occurs in the system. Obviously, the notification service is a cross-cutting concern because the notification logic is scattered throughout many methods in many classes. Implementing the notification logic with OOP involves changing the other concerns.

Assume that we have a StudentService class in our application, which performs all student-relevant operations, including student registration, profile updating, and so on. A requirement of the application indicates that StudentService must notify the system administrator after an exception is thrown in the StudentService object.

Let's see how the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required