Java Reference
In-Depth Information
9.2 Identifying the transaction scripts
We are now going to take a step back and look at how to develop a transaction
script-based design from scratch. We'll describe how to implement transaction
script-based business logic using the Place Order use case as an example. You will
learn how to develop working and tested transaction scripts and DAO s from the
use case and the UI design. We'll also describe how to use Spring for transaction
and connection management.
The process of developing Transaction Script pattern-based business logic con-
sists of the following steps:
Identify the transaction scripts.
1
Implement and test the transaction scripts using mock DAO s.
2
Implement and test the DAO s.
3
Configure Spring beans to provide JDBC transaction and connection man-
agement.
4
Let's start by identifying the transaction scripts; later sections describe the other
steps. The techniques for identifying transaction scripts are similar to the ones
used in chapters 3 and 7 to design the domain model service and the POJO
façade, but we'll review the basic process here.
9.2.1
Analyzing the use case
You can identify the transaction scripts and determine their responsibilities,
parameters, and return types by analyzing the use case and the user interface. The
transaction scripts typically correspond to the steps of the use case. Consider, for
example, 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.
 
 
 
 
 
Search WWH ::




Custom Search