| CONTENTS | PREV | NEXT | INDEX | J2EE BluePrints |
The sample application models a typical e-commerce application, an online pet store. E-commerce sites like this are among the most common Web applications. The application interface is presented to its customers through a Web site and a customer interacts with the application using a Web browser. Other potential users of the application include administrators responsible for maintaining inventory and performing other managerial tasks, and associated businesses such as suppliers. Each class of users would have access to specific categories of functionality, and each would interact with it through a specific user interface mechanism.
Like a typical e-commerce site, the pet store presents the customer with a catalog of products. The customer selects items of interest and places them in a shopping cart. When the customer has selected the desired items and indicates readiness to buy what is in the shopping cart, the sample application displays a bill of sale: a list of all selected items, a quantity for each item, the price of each item, and the total cost. The customer can revise or cancel the order. When the customer is ready to accept the order, the customer provides a credit card number to cover the costs and supplies a shipping address.
The following scenarios demonstrate a few key ways the pet store application could be used by describing a user's view of interactions with the system. By walking through these scenarios, you'll gain a better understanding of the requirements as well as the interactions that happen within the system.
The sample application could support three very different kind of scenarios. First, there is the shopping interface described earlier, that allows shoppers to buy items online. Second, there is an administration interface for carrying out store administration activities. Finally, there is a business-to-business interface through which the store can interact with suppliers. The scenarios in this section demonstrate all three types of interaction, while the remainder of this chapter focuses mainly on the shopping interactions.
10.1.1.1 Shopping Scenario
The primary function of the sample application is to provide an interface where customers can browse through and purchase items. This shopping interaction typically starts with the customer's visit to the application home page and ends when the customer orders from the site:
Cats to view all cats that the pet store sells. Alternatively, the customer can search for products using one or more keywords describing the product. For example searching with keywords Persian and mammal might bring a list of Persian dogs and cats.
This is a fairly typical shopping scenario. Some variations are possible, especially in the way the catalog is presented to the customer. For instance, the application could provide specialized lists of items such as best-sellers, or discounts on certain items. There may also be variations in order processing, such as reducing the steps for making an order when the customer is already signed in. The application developer needs to design the application to support these variations, as well as others that might arise as the application evolves.
Although this scenario presents the application from a single customer's point of view, the pet store application needs to simultaneously support a large number of shoppers.
10.1.1.2 Administration Scenario
The pet store application does most of the administrative work of managing orders, creating new accounts, and other details without manual intervention. However, there are some tasks where manual intervention is desirable or required. These are often administration tasks, such as managing the inventory, reestablishing forgotten customer passwords, rolling back orders, handling returned merchandise, and processing and shipping of orders.
The administration interface of the pet store application could use a Visual Basic client running in a Microsoft desktop application such as Microsoft Excel. The application must be designed to support more than one administrator simultaneously using the administration interface.
The administration scenario models inventory management, where an administrator updates inventory when new shipments come in:
10.1.1.3 Business-to-Business Scenario
Businesses often have a need to interact with other businesses through their custom applications. For example, a retailer needs to work with suppliers to procure inventory, with shipping agencies for managing shipments, and with billing agencies for handling its billing needs. In fact, significant pieces of the application such as inventory control could themselves be off-loaded to a separate business.
It would be desirable to have some of these interactions be automated. When businesses are tightly coordinated, perhaps under the same ownership or administration, these interactions could be closely-coupled. In such interactions, businesses expose their entities and data to each other. However, most of the time it is desirable to keep the businesses loosely-coupled. Here businesses interact by passing asynchronous messages to each other. This messaging approach also models the real world more closely, where businesses work together by sending faxes and packages, and so on, to each other.
An interaction between the pet store and one of its suppliers would illustrate a loosely-coupled business interaction. A typical scenario might be:
The interaction between the store and supplier is depicted in a timing diagram in Figure 10.1.
Figure 10.1 A Store-Supplier Business-to-Business Interaction
One thing to observe about this scenario that it is asynchronous. The action is initiated when a customer places an order. However, it proceeds without blocking the customer's interaction. Also note that neither the store nor the supplier is blocked waiting for the other to respond. While the procurement is in progress, the store's application and the supplier's system carry on with their activities as usual.
With a clear understanding of the kind of scenarios in which the application would be used, let's create an initial specification of the user interface of the application. This section presents a sketch of the main user interface of an application that supports the shopping interactions. It is possible to create a similar sketch for a user interface for administration interactions. Business interactions typically do not require a user interface. As mentioned earlier, the remainder of this chapter focuses on the shopping functionality of the application.
Upon arriving at the main page of the online pet store, a customer would expect some of the following features:
- A set of links or navigation bars on each page that provide quick access to common navigational tasks.
- An organized view of the site's contents through a categorized catalog.
- A search mechanism to provide a way to locate items based on keyword descriptions. Other types of quick access could be in terms of popular items or new additions.
- A master view of the catalog that lists items of interest. This could be the result of the customer navigating through a catalog category or the outcome of a keyword search.
- A detail view that describes the details of a particular item. Shoppers click on an item in the master view to zoom in on details, including a description, a picture, the price, a link to the supplier's URL, and so on.
- A shopping cart view that lets customers review the contents of their shopping cart. The cart allows the customer to modify quantities of items in the cart, including removing items from the cart altogether.
- A checkout or bill-of-sales view that displays the total order cost and allows the customer to enter billing and shipping information. The customer will want assurance that order details including shipping and credit card information are transferred securely and accountably. The interaction must be authenticated to positively identify the customer for the purposes of accountability and encrypted through HTTPS to protect the privacy of the information the customer provides.
- A receipt view to provide confirmation of the purchase through a unique order identifier or other mechanism to track the newly placed order and review details of the order.
In addition to these user interface requirements, the application must also support some security requirements. We address these in Section 10.11.