The Aspect, Advice and PointCut

One of the major features of any system is audit trailing or user logging. The system must handle the logging of all transactions that a user has executed in a portal. Not only that, it must also complete information on the logging of transactions from the moment the user has opened the application.

Interceptors can be used here, but the most appropriate solution is the Aspect Oriented Programming (AOP) support of Spring MVC 4.x, since the nature of execution of auditing and logging can be configured to cut across different classes. We simply used some of Aspects for logging service methods and formulate some of PointCut to be executed mostly by @After advice. An example of SMP logger is shown as follows:

@Aspect ...

Get Spring MVC Blueprints 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.