Cross-Cutting the MVC

Interceptors are not only confined to managing requests but also to establishing a set of behaviors of the applications, such as transaction logging, data transaction management, custom authorization and authentication, managing services, caching, and workflow simulation.

Spring 5.0 still supports AOP, which is a programming paradigm that implements a functionality or concern which may not be part of the business process but is essential to some areas of the application. These concerns or sets of behaviors are linked to some objects in order to work, like the HandlerInterceptor (which can intercept anywhere in the application).

There are two main classifications of concerns and these are the major concerns, which cater to only a single component of the Spring MVC, and the global concerns, which are applied throughout the application and also may affect the whole transaction flow.

The following recipes will cover how to implement major concerns such as managing the request handlers, services, and DAO transactions. Moreover, some of the recipes will also discuss exception handling, logging, custom security, managing session and request attributes, and restricting user access, which are all part of the global concerns.

In this chapter, you will learn the following:

  • Logging and auditing service methods
  • Managing DAO transactions
  • Monitoring services and request handlers
  • Validating parameters and arguments
  • Managing exceptions
  • Implementing the caching mechanism
  • Intercepting request transactions
  • Implementing user authentication
  • Accessing with restrictions
  • Controlling concurrent user access
  • Implementing a mini-workflow using AOP
..................Content has been hidden....................

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