Java Reference
In-Depth Information
Scheduler
Transaction Interceptor
<<interface>>
RestaurantNotification
TransactionScripts
RestaurantNotification
TransactionScriptsImpl
sendOrders()
void sendOrders()
<<interface>>
RestaurantNotification
Gateway
<<interface>>
OrderDAO
Order.xml
sendOrder()
findOrdersToSend()
markOrdersAsSent()
<sqlMap>
<select
name="findOrdersToSend" ... >
SELECT ...
</select>
OrderDAOIBatisImpl
OrderDTO
<update
name="markOrdersAsSent" ... >
UPDATE ...
</update>
findOrdersToSend()
markOrdersAsSent()
...
</sqlMap>
SqlMapClient
Template
queryForList()
update()
Figure 12.3
Transaction script-based design for the Send Orders to Restaurant use case
SQL
statements that are executed by the
OrderDAO
and the configuration of the
Spring
TransactionInterceptor
or
JDBC
DataSource
.
The key classes in the design are:
■
RestaurantNotificationTransactionScripts
, which
implements
the transac-
tion script
■
Scheduler
, which periodically invokes the
RestaurantNotificationTransac-
tionScripts
Search WWH ::
Custom Search