Make the Most of J2EE Enterprise BluePrints (Continued)
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).
Back to top