Presentation Tier Refactorings

The refactorings in this section apply to the presentation tier.

Introduce a Controller

Control logic is scattered throughout the application, typically duplicated in multiple Java Server Page (JSP) views.

Extract control logic into one or more controller classes that serve as the initial contact point for handling a client request.

Figure 5.1. Introduce a controller

Motivation

Control code that is duplicated in multiple JSPs also needs to be maintained in each JSP. Extracting this code into one or more centralized controller class improves the modularity, reusability, and maintainability of the application.

Mechanics ...

Get Core J2EE™ Patterns: Best Practices and Design Strategies 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.