In this exercise, you create the Display Balance sequence diagram. The Display Balance sequence diagram shows the workflow of the functional task.
The Display Balance 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 dynamic information.
The Display Balance sequence diagram shows the steps that occur when the user clicks Display Balance 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. The sequence diagram describes the dynamic information that is necessary to understand the temporal flow of data. When you create the sequence diagram, you discover all the operations in each class in the use case.
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 however, you create the complete Display Balance 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 Display Balance sequence diagram. The lifelines represent the participants that you identified in the Display Balance Participants diagram. The lifelines are organized sequentially and are arranged with the primary message-initiating classes on the left side of the diagram.
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 Display Balance sequence diagram. The diagram shows the sequence of steps that occur when the user clicks Display Balance on the main menu. After the customer clicks Display Balance in the main menu, the MenuForm class the display operation on the DisplayBalanceForm class, which calls the findForCustomer operation on the the Account class to find the balance for the current customer. The DisplayBalanceForm class can call the getBalance operation on the Account class repeatedly to return the balance for an account. Your diagram should look similar to the following figure:
The Display Balance sequence diagram completes the Display Balance use case realization. You have modeled the static and dynamic information of the Display Balance functional task. If you open the Display Balance participants diagram, you notice that the diagram now contains the operations that you created as messages in the sequence diagram. The Display Balance participants diagram should look similar to the following figure:
To continue, proceed to Exercise 2.7: Creating the Transfer Money participants diagram.