You can create inheritances (also known as generalizations)
by using the Generalization arrow to draw a connection between two
classes on a diagram.
You can also create inheritances
by using the command from the
browser in IBM® Rational® Rhapsody®.
Procedure
To create inheritances among classes on a drawing:
- Click the Generalization button
,
and then click in the subclass, for example, class B.
- Move the cursor and click in the superclass,
for example, class A, to end the arrow.
- Create a generalization from, for example, class C to class
A. Notice that by default, the lines appear in a tree style, as shown
in the following figure:
If you add another class to your diagram, for
example, class D, you can add it to the tree structure by clicking
the Generalization arrow from class D onto class A or onto a line
on that tree.
Note: If the line style for generalizations is not
set to display in a tree style by default, to apply this line shape
to two or more generalization lines pointing to the same target, select
one of the generalization lines (for example, from class B to class
A) and select . You can also do this by targeting a generalization
line to another generalization line that points to the same target.
For example, if you have a generalization line from class B to class
A, you can create a tree structure by touching the BA line with the
generalization line from class C.
Results
The tree line shape is also available for realizations
on object model diagrams and generalizations on use case diagrams.
For
object model diagrams, the line shape for generalizations is set by
the ObjectModelGe::Inheritance::line_style property
and for realizations by the ObjectModelGe::Realization::line_style property.