Object-Oriented Analysis and Design 357
11
the UML is not terribly difficult, it is a one-way street. After you move your classes into
UML diagrams, there is no turning back; you set aside the CRC cards and don’t come
back to them. It is simply too difficult to keep the two models synchronized with one
another.
Transforming CRC Cards to UML Each CRC card can be translated directly into a
class modeled with the UML. Responsibilities are translated into class methods, and
whatever attributes you have captured are added as well. The class definition from the
back of the card is put into the class documentation. Figure 11.13 shows the relationship
between the CheckingAccountCRC card and the UML class created from that card.
Class:CheckingAccount
SuperClass:Account
Responsibilities:
Track current balance
Accept deposits and transfers in
Write checks
Transfer cash out
Keep current day’s ATM withdrawal balance
Collaborations:
Other accounts
Back-office systems
Cash dispenser
FIGURE11.13
CRC card.
<<Abstract>>
Account
Checking Account
Balance : int
DaysATMWithdrawal : int
GetBalance() : int
Deposit(int amount)() : void
TransferIn(int amount)() :bool
TransferOut() : int
WriteChecks(int amount)() : bool