Sams Teach Yourself C++ in 21 Days

(singke) #1
Object-Oriented Analysis and Design 343

11


The diagram in Figure 11.7 states that a Checking Account and a Savings Account are
both Bank Accounts, and that all Bank Accounts have both a Balance and a Transaction
History.
Association The third relationship commonly captured in the domain analysis is a
simple association. An association suggests that two objects interact in some way, with-
out being terribly precise about what that way actually might be. This definition will
become much more precise in the design stage, but for analysis, it is only being sug-
gested that Object A and Object B interact, but that neither contains the other and neither
is a specialization of the other. This association is shown in the UML with a simple
straight line between the objects, as shown in Figure 11.8.

FIGURE11.8
Association. Object A Object B


Association

The diagram in Figure 11.8 indicates that Object A associates in some way with
Object B.

Establishing Scenarios
Now that you have a preliminary set of use cases and the tools with which to diagram the
relationship among the objects in the domain, you are ready to formalize the use cases
and give them more depth.
Each use case can be broken into a series of scenarios. A scenariois a description of a
specific set of circumstances that distinguish among the various elements of the use case.
For example, the use case “Customer withdraws money from his account” might have
the following scenarios:


  • Customer requests a $300 withdrawal from checking, takes the cash from the cash
    slot, and the system prints a receipt.

  • Customer requests a $300 withdrawal from checking, but his balance is $200.
    Customer is informed that not enough cash is in the checking account to accom-
    plish the withdrawal.

  • Customer requests a $300 withdrawal from checking, but he has already withdrawn
    $100 today and the limit is $300 per day. Customer is informed of the problem,
    and he chooses to withdraw only $200.

Free download pdf