Java Reference
In-Depth Information
specifically for a single use case, others are shared by multiple use cases and so it is
essential that the developers collaborate closely.
In this section we show how a developer might go about designing the business
logic for a use case and direct you to the chapters that will teach you how to imple-
ment the chosen options. It's important to remember, however, that the decisions
made by each developer in this section are only one of several different ways to
implement the use case. Consequently, we also point you to the chapters that
describe how to implement alternative approaches. Let's look at each of the use
cases and see which options the developer's pick.
The Place Order use case
Mary is responsible for implementing the Place Order use case:
The customer enters the delivery address and time. The system first verifies that
the delivery time is in the future and that at least one restaurant serves the deliv-
ery information. It then updates the pending order with the delivery informa-
tion, and displays a list of available restaurants.
The customer selects a restaurant. The system updates the pending order with
the restaurant and displays the menu for the selected restaurant.
The customer enters quantities for each menu item. The system updates the
pending order with the quantities and displays the updated pending order.
The customer enters payment information (credit card information and billing
address). The system updates the pending order with the payment information
and displays the pending order with totals, tax, and charges.
The customer confirms that she wants to place the order. The system authorizes
the credit card, creates the order, and displays an order confirmation, which
includes the order number.
As you can see, the business logic for this use case is fairly complex, and so it
makes sense to implement it using a domain model that is persisted with JDO .
Database concurrency isn't an issue because this use case does not update any
shared data. The pending order is data that is private to a single user's session and
the order, which is shared data, is not updated in this use case once it has been
created. After analyzing the use case, Mary makes the decisions shown in table 2.3.
In chapter 4, you will learn how to develop a domain model for the Place Order
use case; chapter 5 shows you how to persist it with JDO . In chapter 6, we describe
 
 
Search WWH ::




Custom Search