In this exercise, you create the Transfer Money sequence diagram. The Transfer Money sequence diagram shows the workflow of the functional task.
The Transfer Money Participants diagram models the structure of the classes in the Display Balance functional task. The diagram also shows the relationships that exist between each class; however, it does not describe the workflow of the functional task. The use case realization relies on a sequence diagram to describe this static information.
The Transfer Money sequence diagram shows the steps that occur when the user clicks Transfer Money on the main menu. The sequence diagram models the use case participants as lifelines and models the data flow as messages to indicate the workflow of the use case. When you model the workflow of the use case in a sequence diagram, you discover the operations that exist in each class. You complete the Transfer Money participants diagram as you discover and create the operations in the Transfer Money sequence diagram.
Modeling is an iterative process. You can modify your sequence diagram at any time as you discover the details of the system. In this tutorial, you create the complete Transfer Money sequence diagram.
Before you can model the workflow, you must first model the lifelines of the sequence diagram. The use case participants form the lifelines of the sequence diagram.
You have created the lifelines of the Transfer Money sequence diagram. The lifelines represent the participants that you identified in the Transfer Money Participants diagram. The lifelines are organized sequentially and are arranged with the primary message-initiating classes on the left side of the diagram. Note that the Account participant occurs twice in the diagram. One Account lifeline represents the account that is being debited, the other Account lifeline represents the account that is being credited.
This exercise models the message flow in the sequence diagram. Messages in a sequence diagram indicate the data flow between classes in a system.
You have modeled the Transfer Money sequence diagram. The diagram shows the sequence of steps that occurs when the user clicks Transfer Money on the main menu. When the customer clicks Transfer Money, a form is displayed on the screen. The customer then fills out the form. The form data is sent to the TransferMoneyController class, which sends a message with the withdraw transaction information to the debit:Account class. The TransferMoney class then sends the deposit transaction information to the credit:Account class. The TransferMoneyController class creates the Transfer object and passes it the debit, credit, and amount information so that it can execute the transaction. A message is then displayed to the user. Your diagram should look similar to the following figure:
The Transfer Money sequence diagram completes the Transfer Money use case realization. You have modeled the static and dynamic information of the Transfer Money functional task. If you open the Transfer Money participants diagram, the diagram contains the operations that you created as messages in the sequence diagram. The Transfer Money participants diagram should look similar to the following figure:
To continue, proceed to Exercise 2.9: Creating the Cash Check participants diagram.