Object-Oriented Analysis and Design 345
11
the customer asks for $300, a legal amount to withdraw at this
time. The machine dispenses $300 and prints a receipt, and the
customer takes the money and the receipt.
Postconditions: Customer account is debited $300, and customer has $300 cash.
This use case can be shown with the incredibly simple diagram given in Figure 11.9.
FIGURE11.9
Use-case diagram.
Withdraw Cash
Association
Customer
Actor Use Case
Little information is captured here except a high-level abstraction of an interaction
between an actor (the customer) and the system. This diagram becomes slightly more
useful when you show the interaction among use cases. I say only slightlymore useful
because only two interactions are possible:<<uses>>and <<extends>>. The <<uses>>
stereotype indicates that one use case is a superset of another. For example, it isn’t possi-
ble to withdraw cashwithout first logging in. This relationship can be shown with the
diagram in Figure 11.10.
FIGURE11.10
The <
stereotype. Withdraw Cash
Customer
Log in
<<Uses>>
Figure 11.10 indicates that the Withdraw Cash use case “uses” the Log In use case, and,
thus, Log In is a part of Withdraw Cash.