J2EE Design Patterns

The J2EE Platform is a special case of both the Client-Server Architecture Pattern and the Multi-Layer Architecture Pattern.

We can equate the web tier with the presentation layer, the EJB tier with the domain layer, and the backend tier (i.e., databases) with the persistence layer.

The web tier is both a client and a server. Its client is the client tier browser. Its servers are the EJB tier and the backend tier. The EJB tier's client is the web tier. Its server is the backend tier.

The web tier consists of web containers. The EJB tier consists of EJB containers. These are special cases of the Container-Component Architecture.

A well designed middle tier starts with the Model-View-Controller Pattern.

Web Tier Patterns

A web-centric application doesn't use an EJB tier. Web-centric applications are appropriate when business logic (i.e., the MVC model) is simple enough to be encapsulated by a few Java Beans.

The views are the pages (static or dynamic HTML) that are displayed by the browser. A view may contain information (output) as well as forms (input).

The controller is the Front Controller, a special JSP or servlet that initially receives the HTTP request (which may contain form data) from the browser. The Front Controller is a special case of the Command Processor pattern.

See the official J2EE pattern catalog for a complete description of all J2EE patterns. We are mostly concerned with the following patterns:

Front Controller, View Helper, Service-to-Worker, and Dispatcher View

DAO and Transfer Object

 

EJB Tier Patterns

References

Designing_Enterprise_Applications

Enterprise Patterns