Specialization

Specialization provides the ability to create subclasses that represent refinements to the superclass—typically, structure and behavior are added to the new subclass. This method of finding inheritance often comes into play if a class already exists. Subclasses are added to specialize the behavior of an existing class. For example, the registration system could be expanded to allow senior citizens to take classes free of charge. A new subclass called SeniorCitizen could be added to the RegistrationUser hierarchy to hold information pertinent to senior citizens.

Operations may be overridden by a subclass. However, a subclass should never restrict an operation defined in its superclasses. That is, the subclass should never provide ...

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.