Java Reference
In-Depth Information
Spring TransactionInterceptor
PlaceOrderTransactionScripts
<<transaction scripts>>
UpdateDeliveryInfoResult updateDeliveryInfo(...)
PlaceOrderResult updateRestaurant(...)
PlaceOrderResult updateQuantities(...)
<<interface>>
RestaurantDAO
<<interface>>
PendingOrderDAO
findRestaurant(id)
isRestaurantAvailable()
findAvailableRestaurants()
PendingOrderDTO create()
PendingOrderDTO find(id)
update(PendingOrderDTO)
PendingOrder
DAOImpl
PendingOrder
DTO
Restaurant
DTO
Restaurant
DAOImpl
PendingOrder
LineItemDTO
MenuItem
DTO
iBATIS
Figure 9.1
An example of a design using the Transaction Script pattern
The transaction scripts use
DTO
s to exchange data with the
DAO
s. The
DAO
s
return the results of a query as one or more
DAO
s, and the transaction scripts
pass
DTO
s to the
DAO
s in order to insert or update data in the database. For
example,
PendingOrderDAO
defines a
findPendingOrder()
method, which returns
a
PendingOrderDTO
that contains the pending order from the database, and a
Search WWH ::
Custom Search