## Class Diagram for the Address Book Example

Shown below is the class diagram for the Address Book Example. 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.

The diagram includes the classes discovered during analysis, plus some additional classes discovered during design. (In a more significant system, the total number of classes may be about five times as great as the number of classes uncovered during analysis.)

- AddressBookApplication - main class for the application; responsible for creating the FileSystem and GUI objects and starting up the application.
- MultiInputPane - a utility class for reading multiple values at a single time. (Design not further documented, but javadoc is included.)
- Person.CompareByName - Comparator for comparing two Person objects by name (used for sorting by name).
- Person.CompareByZip - Comparator for comparing two Person objects by zip (used for sorting by name).

The following relationships hold between the objects:

- The main application object is responsible for creating a single file system object and a single controller object.
- The file system object is responsible for saving and re-loading address books
- The controller object is responsible for creating a single GUI object.
- The controller object is responsible for initially creating an address book object, but the GUI is henceforth responsible for keeping track of its current address book - of which it only has one at any time.
- The GUI object and the address object are related by an observer-observable relationship, so that changes to the address book content lead to corresponding changes in the display
- The address book object is responsible for creating and keeping track of person objects, of which there can be many in any given address book.
- A MultiInputPane object is used by the controller to allow the user to enter multiple items of data about a person.
- A comparator object of the appropriate kind is used by the address book object when sorting itself.

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

Page of links for non frames-enabled browsers.

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