Documenting Classes

I l @ ve RuBoard

As classes are created, they should also be documented. The documentation should state the purpose of the class and not the structure of the class. For example, a Student class could be documented as follows :

Information needed to register and bill students. A student is someone currently registered to take classes at the University.

A bad definition would be the following:

The name , address, and phone number of a student.

This definition only tells me the structure of the class, which can be determined by looking at its attributes. It does not tell me why I need the class.

Difficulty in naming or documenting a class may be an indication that it is not a good abstraction. The following list typifies things that can happen as classes are named and documented:

  • Can identify a name and a clear concise definitiongood candidate class

  • Can identify a name, but the definition is the same as another classcombine the classes

  • Can identify a name, but need a book to document the purposebreak up the class

  • Cannot identify a name or a definitionmore analysis is needed to determine the correct abstractions


  1. Click to select the class in the browser.

  2. Position the cursor in the documentation window and enter the documentation for the class.

The description of the Student class is shown in Figure 4-6.

Figure 4-6. Class Documentation


I l @ ve RuBoard

Visual Modeling with Rational Rose 2002 and UML
Visual Modeling with Rational Rose 2002 and UML (3rd Edition)
ISBN: 0201729326
EAN: 2147483647
Year: 2002
Pages: 134

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: