Documenting Classes

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 ...

Get Visual Modeling with Rational Rose 2002 and UML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.