previous | start | next

Discovering Classes

From a problem description (or the problem described again in your own words), make a list of candidate classes from the named objects (the nouns) in the description.

Decide which nouns are likely to be classes and which other nouns might be properties (data members) of classes.

Select one of the candidate classes and make a list of what responsibilities it might have.

For each responsibility think about whether it would need to use another class to accomplish that responsibility and if so indicate the other class as a collaborator of this class.

If you find a collaborator, make it be a separate candidate class and list its responsibilities

A class may or may not have collaborators.

Clearly this is an iterative process.



previous | start | next