[Top] [Prev] [Next] [Bottom]

J2EE Application Example:
A Web Store

The JavaTM 2 Platform, Enterprise Edition can be used to build a wide range of services. This section describes how the J2EE platform was used to create a web store-CHEAPBOOKS.COM. As the example shows, the middle-tier of the J2EE platform provides the complete foundation upon which this service's presentation, business logic, and EIS access is built. FIGURE 1 illustrates the J2EE components that were used to create the Web store sample application.

The most significant thing about this web store example is what is not illustrated. The normal complexity you would expect to see is not here because it did not have to be built by the developers of the store. Instead, the developers used the J2EE platform's built-in support for middle-tier development.

The J2EE application programming model guided the developers of the web store through the development process. The model simplified their work by naturally separating the components used for presenting the store (JSPs) from those that implement the store's business processes (EJBs). In both areas, the J2EE application model allowed the developers to dedicate their time to the application details specific to the business of managing a bookstore, while behind the scenes the J2EE platform handled the application's complex system and resource demands.

JavaServer Pages simplified the task of customizing the store's presentation to individual customers. JSP pages provide an easy-to-use combination of HTML and Java that efficiently generates a customer-specific view of the store. Since JSP technology also provides a built-in facility for calling Enterprise JavaBeans components, the store's presentation components could access its business functions simply and directly.

Enterprise JavaBeans components significantly reduced the effort needed to build the store's business functions. Instead of having to write complex state management code, the developer built the "shopping cart" enterprise bean and let the J2EE platform automatically manage its state. Instead of spending time designing and building a database connection manager, the developer built the "catalog" enterprise bean and let the J2EE platform handle connection management. Since EJB technology makes it easy to combine multiple actions into a single transaction, order-processing problems caused by partial failure of a purchase are avoided. This reduces the need for customer service involvement and results in greater customer satisfaction.

Since the J2EE platform provides back-office access APIs that are integrated as a standard part of the platform, the store's business functions were developed and integrated with the company's existing systems, all within one consistent environment.

The productivity of the Java platform plus the sophisticated middle-tier facilities provided by the J2EE platform significantly reduced the time to market: the elapsed time required to get the online store operational. Because J2EE is an open standard, the store developers were able to select the vendor and computing hardware that best fit their needs for functionality, performance, and reliability. In addition, the wide selection of development and content authoring tools that can be used with J2EE gave the developers the flexibility they needed to build a highly competitive store.

The internet economy dramatically reduces the cost of switching from one vendor to another for goods and services. E-commerce vendors who lock themselves into single-platform solutions today may be restricting their ability to respond quickly to changes in the market tomorrow. By applying the J2EE platform to their e-commerce needs, organizations give themselves additional flexibility for maintaining and building market share.

The middle-tier architecture needed to implement the web store is very similar to the architecture needed to implement a wide range of services that directly reach the important wide range of customers, employees, partners and suppliers that an enterprise in today's world must directly and efficiently interact with. Typical examples of these services are customer management, supply chain management, and employee expense accounting.

FIGURE 1 illustrates how the CHEAPBOOKS.COM web store was implemented as a J2EE application.

CHEAPBOOKS.COM, A Web Store Example

For a more complete example of the J2EE application model, see the Sun BlueprintsTM Design Guidelins for J2EE at http://java.sun.com/j2ee/blueprints. These design guidelines will also be presented in the forthcoming Addison-Wesley Java Series book, Designing Enterprise Applications with the Java 2 Platform, Enterprise Edition. The design guidelines include a sample application demonstrating the model, and discussions of best practices for using various services provided the J2EE platform.



[Top] [Prev] [Next] [Bottom]

Copyright © 1999, Sun Microsystems, Inc. All rights reserved.