CONTENTS | PREV | NEXT | INDEX Designing Enterprise Applications
with the J2EETM Platform, Second Edition



4.3 Web-Tier Application Structure

The J2EE platform is a layered set of system services that are consistently available to J2EE applications across implementations. It is the top layer of a "stack" of services that support an application, shown in Figure 4.1. The J2EE platform runs on top of the J2SE platform, which itself runs on top of the host operating system. In the Web tier, a J2EE Web container provides services related to serving Web requests.

Figure 4.1 Platform and Application Layers

Just as the J2EE platform has layers, J2EE applications can benefit from architectural layering. The highest-level division between layers in an application's Web tier is between functions that are specific to a particular application and those that occur in all Web applications.

All Web-tier applications share a common set of basic requirements that are not provided by the J2EE platform itself. A software layer called an application framework can meet these requirements and can be shared between applications. As shown in Figure 4.1, application-specific code is written in terms of the application framework layer.

A Web-tier application framework sits on top of the J2EE platform, providing common application functionality such as dispatching requests, invoking model methods, and selecting and assembling views. Framework classes and interfaces are structural; they are like the load-bearing elements of a building, forming the application's underpinnings. Application developers extend, use, or implement framework classes and interfaces to perform application-specific functions. For example, a framework may offer an abstract class that a developer may extend to execute business logic in response to application events. A Web-tier application framework makes Web-tier technologies easier to use, helping application developers to concentrate on business logic.

The BluePrints recommended best practice is to choose an existing, proven Web-tier application framework for a J2EE application rather than designing and building a custom framework layer. A Web-tier application framework can provide the following benefits to your application:

All of these benefits come at a cost, of course. You always have less control over a design you have acquired rather than created yourself. Some frameworks must be purchased, although these are usually bundled with a tool set. Other people's code in your application means other people's bugs in your application. Still, most development projects find that a Web-tier framework improves design and implementation quality.



CONTENTS | PREV | NEXT | INDEX
Copyright © 2002 Sun Microsystems, Inc. All Rights Reserved.