Java Reference
In-Depth Information
every ATM usage scenario to verify that.) There are not too many collaboration
dependencies between the classes. Thus, I was satisfied with this design and
proceeded to the next step.
12.5.3 UML Diagrams
Figure 11
shows the relationships between these classes, using the graphical user
interface. (The console user interface uses a single class
ATMSimulator
instead
of the
ATMFrame
and
Keypad
classes.)
Figure 11
Relationships Between the ATM Classes
561
562
To draw the dependencies, use the Ȓcollaboratorȓ columns from the CRC cards.
Looking at those columns, you find that the dependencies are as follows:
ȗ
ATM
uses
Bank
,
Customer
, and
BankAccount
.
ȗ
Bank
uses
Customer
.
ȗ
Customer
uses
BankAccount
.
It is easy to see some of the aggregation relationships. A bank has customers, and
each customer has two bank accounts.