## Class Diagram for Example ATM System

Shown below is the class diagram for the ATM system. The basic structure of the class diagram arises from the responsibilities and relationships discovered when doing the CRC cards and Interaction Diagrams. (If a class uses another class as a collaborator, or sends a message to an object of that class during an Interaction, then there must either be an association linking objects of those classes, or linking the "sending" class to an object which provides access to an object of the "receiving" class.)

In the case of the ATM system, one of the responsibilities of the ATM is to provide access to its component parts for Session and Transaction objects; thus, Session and Transaction have associations to ATM, which in turn has associations to the classes representing the individual component parts. (Explicit "uses" links between Session and Transaction, on the one hand, and the component parts of the ATM, on the other hand, have been omitted from the diagram to avoid making it excessively cluttered.)

The need for the various classes in the diagram was discovered at various points in the design process.

- Some classes were discovered when doing analysis (see the Analysis Class Diagram developed earlier.)
- Some classes were discovered when doing CRC cards
  - Message - used to represent a message to the bank.
  - Receipt - used to encapsulate information to be printed on a receipt.
  - Status - used to represent return value from message to the bank.
  - Balances - used to record balance information returned by the bank.
- Some classes were discovered when doing detailed design or writing code
  - Money - used to represent money amounts, in numerous places.
  - AccountInformation - contains names of various types of accounts customer can choose from

That is, OO design is not a "waterfall" process - discoveries made when doing detailed design and coding can impact overall system design.

To prevent the diagram from becoming overly large, only the name of each class is shown - the attribute and behavior "compartments" are shown in the detailed design, but are omitted here.

#### Click on a class icon for links to further information about it

Page of links for non frames-enabled browsers.

###### Copyright © 2000, 2001, 2002 - Russell C. Bjork. Permission for non-commercial reproduction for educational use is hereby granted; all other rights are reserved.