O'Reilly logo

Visual Modeling with Rational Rose 2002 and UML by Terry Quatrani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Splitting Classes

Classes should be examined to determine if they are following the golden rule of OO, which states that a class should do one thing and do it really well. They should be cohesive; for example, a StudentInformation class that contains information about the Student actor as well as information about what courses the student has successfully completed is doing too much. This is better modeled as two classes—StudentInformation and Transcript, with an association between them.

Often, what appears to be only an attribute ends up having structure and behavior unto itself and should be split off into its own class. For example, we'll look at Departments in the university. Each Course is sponsored by a Department. Initially, this information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required