Make the Most of J2EE Enterprise BluePrints
Leverage the wealth of information and experience documented in the J2EE Enterprise BluePrints.
by Paul Philion
Posted June 28, 2004
The Java 2 Platform, Enterprise Edition (J2EE) has never been lightweight, and J2EE 1.4 adds even more specifications and functionality. J2EE can be overwhelming even for experienced IT folks who have tried to keep up on all the new and extended features. For those new to J2EE, the J2EE specification and all its related technologies can be downright intimidating.
J2EE's authors recognize its complexity and have been providing extensive documentation and examples called "blueprints" for J2EE. These blueprints navigate developers through the proper uses of J2EE and its associated technologies. This article describes the latest version of the J2EE Enterprise BluePrints and offers a few guidelines about how to make the most of them.
According to Sun's Web site (see Resources), Enterprise BluePrints "define the application programming model for end-to-end solutions" and include "guidelines, patterns, and code for real-world application scenarios." They enable J2EE developers to "build robust, scalable, and portable solutions."
Sun provides sets of blueprints for several different technical areas, including Enterprise, Wireless, Performance, and Web Services.
Enterprise BluePrints
Sun's Enterprise BluePrints are a collection of resources describing the use of J2EE technologies to solve real-world, enterprise-level problems. These resources include development guidelines, design patterns, and especially sample projects to demonstrate the appropriate application of J2EE technologies in a complex multitier environment, including Web tier (servlets and JavaServer Pages), business tier (Enterprise JavaBeans), and integration tier (Java Message Service, Java Database Connectivity).
The Enterprise BluePrints provide detailed information on the most effective use of each J2EE component technology and their interactions, the appropriate use of session vs. entity beans, the tradeoffs between container-managed and bean-managed persistence, and how to secure a J2EE enterprise application. Tied together with the source code of complete, complex enterprise applications, the Enterprise BluePrints condense a wealth of information and experience into a cohesive, well-documented set of best practices for J2EE development.
J2EE Guidelines
The J2EE blueprints' goal is to allow J2EE developers to manage complexity, leverage community experience, and reuse proven approaches and designs. Sun provides the contents of several books about J2EE architecture and design as part of the blueprints—not just a few sections or chapters, but entire J2EE books written by the J2EE's creators. The most significant of these are Designing Enterprise Applications with the J2EE Platform, 2nd Edition and Designing Web Services with the J2EE 1.4 Platform (see Resources).
These books are important because they describe how the J2EE technologies work, how you should use them along with the design principles behind the J2EE component frameworks, and how those principles drive the interactions among the components. The overall J2EE framework is so complex that it's difficult to know how to use it without understanding the underlying reasons. The Enterprise BluePrint guidelines, in the form of these books and other online articles, provide both the how and the why of J2EE technologies.
J2EE 1.4 Tutorial
Another set of guidelines is the J2EE 1.4 tutorial, which covers a wide range of the technologies in J2EE, including JAXP; JAX-RPC; SAAJ; JAXR; servlets; JSP; JSTL; JavaServer Faces; internationalization; session, entity, and message-driven beans; EJB query language; transactions; security; and JMS.
These technologies are presented with step-by-step instructions on how to get a J2EE sample system running, how to use the specific technologies, and the roles of each technology within a J2EE-based enterprise application. The tutorial is important for both beginning J2EE developers and experienced Java developers who want to learn more about a specific new J2EE technology (such as Web services or JavaServer Faces) or the new features of an existing technology (such as EJB).
Core J2EE Design Patterns
Design patterns play an important role in software design (and thus development) because they provide proven solutions to common design issues and outline the tradeoffs of various design decisions. Further, they are reusable across any field or specialty in design because rather than provide a specific "solution" to a problem (such as a library, component, or object method), they instead provide a set of design criteria for solving the design problem. Design patterns have become widespread because they do an excellent job of describing specific software designs and their associated information (such as intent, motivation, structure, participants, consequences, known uses, and related patterns) succinctly, using simple terms such as "Factory Method," "Iterator," and "Strategy" (from Design Patterns).
As part of the blueprints, Sun provides a catalog of J2EE design patterns (also available in Core J2EE Patterns). These design patterns serve as the basis for the software design and architecture documented in the guidelines and expressed in the sample applications. The core J2EE design patterns provide a strong base for designing numerous types of enterprise applications and are applicable to enterprise software design in general, outside J2EE-specific solutions.
There are too many design patterns to document in this article, but several play important roles in the Enterprise BluePrints. The Business Delegate pattern decouples the Web (presentation) tier from the specific implementation of the business logic. For example, a JSP page might rely directly on an EJB invocation (and associated service lookup) to present some data to the end user. This requires a complex scriptlet in the JSP page and is difficult to maintain if the JSP page relies on any changes in the business tier. With a Business Delegate to separate the presentation from the underlying EJB implementation, the JSP page becomes simpler and easier to maintain, and the business tier can change accordingly. For example, you can replace the EJBs with Data Access Objects (DAOs).
DAO is another widely used design pattern. It abstracts and encapsulates all access to an underlying data source, such as a database or an XML file. The DAO hides the underlying source of the data and format in which it is stored. This simplifies the business object (such as a Business Delegate) based on the DAO and allows migration to different data sources (file to database, for example).
Sample Enterprise Applications
The Enterprise BluePrints contain two major applications to demonstrate J2EE technologies. Both are robust J2EE-based enterprise applications that leverage all the other blueprint resources (guidelines, patterns, and so on). These specific examples of the J2EE technologies working in tandem to complete a solution are the focal point of the blueprints.
The original blueprint project, Pet Store, was developed to demonstrate the proper use of the different types of EJBs and how those beans are tied to a Web-based interface using servlets and JSP pages, based on the guidelines and core patterns. The latest blueprints introduce Adventure Builder, a Web application based on J2EE 1.4 technologies, which focuses on the Web tier and Web services without using EJBs in the business tier.
Both sample applications are important because they put the J2EE technologies into context. They are not simply code snippets or examples, but living, breathing enterprise applications. They provide a concrete way to learn how each technology works and how they work together; they exemplify the guidelines and design patterns, making them more accessible. Further, you can use them as a starting point for developing your own enterprise applications.
On the whole, the Enterprise BluePrints offer a complete collection of resources for learning about developing J2EE enterprise applications. The guidelines, design patterns, and sample applications are valuable to J2EE novices and experts alike. You can greatly improve your next J2EE application using the wealth of information and experience in the blueprints.
About the Author
Paul Philion has been developing in Java professionally since JDK 1.0a2. He is a Sun-certified Java programmer, developer, architect, and Web component developer. He is the principal architect at Acme Rocket Company, where he designs enterprise systems, tinkers with new technologies, and expresses his opinions (loudly).
|