Specialization

I l @ ve RuBoard

Specialization provides the ability to create subclasses that represent refinements to the superclasstypically, 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 less behavior or structure than its superclasses.

CREATING INHERITANCE IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Open the class diagram that will display the inheritance hierarchy.

  2. Click to select the Class icon from the toolbar and click on the open class diagram to draw the class.

  3. With the class still selected, enter the name of the class.

    Note

    The class could also be created in the browser and added to the open class diagram.

  4. Click to select the Generalization icon on the toolbar.

  5. Click on a subclass and drag the generalization line to the superclass.

  6. Repeat step 5 for each additional subclass.

An inheritance relationship is shown in Figure 8-1.

Figure 8-1. Inheritance Relationship

graphics/08fig01.jpg

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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net