In this exercise, you create the Cash Check sequence diagram. The Cash Check sequence diagram shows the workflow of the Cash Check functional task.
The Cash Check Participants diagram models the structure of the classes in the Cash Check 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 uses on a sequence diagram to describe this static information.
The Cash Check sequence diagram shows the steps that occur when the user clicks Cash Check on the main menu. The 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 can complete the Cash Check participants diagram as you discover and create the operations in the Cash Check sequence diagram.
Modeling a system 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 Cash Check 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 Cash Check sequence diagram. The lifelines represent the participants that you identified in the Cash Check Participants diagram. The lifelines are organized sequentially and are arranged with the primary message-initiating classes on the left side of the diagram. There are two CityBank lifelines. The first CityBank lifeline represents the CityBank banking system that is used to verify PiggyBank transactions. The second CityBank lifeline, which references the CityBank actor that you created in the use case diagram, represents the CityBank institution.
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 Cash Check sequence diagram. The diagram shows the sequence of steps that occurs when the user clicks Cash Check on the main menu. When the teller clicks Cash Check, a message is sent to the CashCheckForm class, which displays a form on the screen. The teller fills out the form, which is then sent to the CashCheckControl class for processing. The CashCheckControl class searches for the account, and then sends a message that contains the transaction information to CityBank. CityBank then cashes the check. The CashCheckControl class calls the deposit method of the credit:Account class and cashes the check in the PiggyBank account. A message is then displayed to the user. Your diagram should look similar to the following figure:
The Cash Check sequence diagram completes the Cash Check use case realization. You have modeled the static and dynamic information of the Cash Check functional task. If you open the Cash Check participants diagram, the diagram contains the operations that you created as messages in the sequence diagram. The Cash Check participants diagram should look similar to the following figure:
To continue, proceed to Exercise 2.11: Documenting the analysis classes.