Chapter 3. Presentation Tier Architecture

All applications eventually evolve into operating systems.

We begin our discussion of enterprise applications with the presentation tier and a single question: how can we manage the evolution of our software? There’s no simple answer. To successfully maintain software over the long term, we must create an architecture that allows the programmer to extend and rearrange the underlying components. The architecture needs to balance flexibility, extensibility, and performance.

In J2EE, the server-side presentation tier is responsible for most of an application’s complexity. Since the presentation tier controls the user experience (and, by extension, the bulk of an application’s feature set), it’s often a magnet for change requests. The servlets, HTML, JSP pages, and other resources that make up the presentation tier tend to evolve like most pieces of complex software. User requests spawn new features, and new features create new code.

Since we know that software evolves, we can make our lives easier by planning for it up front. The extensibility of software determines how easily changes can be accommodated. Does a word processor need to be rewritten to add an email client? What about adding a spellchecker? An extensible program changes gracefully: adding and updating features has minimal impact on the rest of the program.

We sometimes know what features we’ll be adding tomorrow, next week, next revision, and next year, and so we can create a software ...

Get J2EE Design Patterns 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.