OIG for Adding a Customer

When the user selects Add from the Customer menu, the banking system performs the following steps:

  1. Prompts the user for the customer's name and address.
  2. Sends this information to the bank where a new customer will be created.
  3. Updates the interface. The new customer's name becomes the currently selected item in the list of customers and the text pane is cleared.

This informal description can be made more precise by specifying a sequence of steps in an object interaction graph as shown in Figure 5.4.


Figure 5.4 Object interaction graph for adding a customer without showing the subsequent updates to the screen

Table 5.5 provides a trace of this sequence of messages.


MessageExplanation
1 select Customer/Add The user selects the Add command in the Customer menu.
2 addCustomer The framework sends the addCustomer message to BankInterface.
3 request customer data The bank interface prompts the user for the customer's name and address.
4 enter customer name and

address

The user enters the name and address of the customer.
5 at: name putAddr: address The bank interface asks the bank to insert the customer's name and address into its database of customers.
6 display duplicate error If customer already exists with this name, display error message.
7 new The bank creates a new customer object.
8 init The customer object is initialized with a default name and address.
9 name: name The customer is told his name.
10 address: address The customer is told his address.

Table 5.5 Trace of messages for adding a customer