Java Reference
In-Depth Information
:PlaceOrder
Transaction
Scripts
:Presentation
Tier
:Browser
enter delivery information(address, time)
updateDeliveryInformation(pendingOrderId, address, time)
PendingOrder+available Restaurants
HTML page
select restaurant (restaurant id)
updateRestaurant(pendingOrderId, restaurant)
PendingOrder+restaurant+menuItems
HTML page
Figure 9.2
Some of the HTTP requests for the Place Order use case
9.2.3
The PlaceOrderTransactionScripts interface
Figure 9.3 shows the outcome of analyzing the Place Order use case and the UI . As
you might expect, the PlaceOrderTransactionScripts interface is very similar to
the PlaceOrderFacade interface developed in chapter 7. After all, they were
derived from the same requirements using the same process. But one important
difference between the two interfaces is that the transaction scripts return DTO s
instead of domain objects. Moreover, as you will see a bit later, their implementa-
tions are very different.
The PlaceOrderTransactionScripts interface specifies transaction scripts for
each step of the use case including updateDeliveryInfo() and updateRestau-
rant() . The transaction scripts return DTO s containing data that is displayed by the
presentation tier or stored as part of the session state. For example, update-
DeliveryInfo() returns an UpdateDeliveryInfoResult , which contains a status
code indicating the outcome of calling the transaction script, a PendingOrderDTO
containing the attributes of the PendingOrder from the database, and a list of avail-
able restaurants. Here is part of the corresponding Java definition of the Place-
OrderTransactionScripts interface:
 
 
 
 
Search WWH ::




Custom Search