Chapter 12. Modeling Guide

How To Draw a Supertype/Subtype Association

We have the following classes: Automobile, Sport and Mini. Mini and Sport are subtypes of the Automobile class.

Now, we want to draw the relationships between these classes.

In the Class Diagram Toolbar select the "New Supertype" button (second button from the right). The arrow takes the shape of a pencil. Place the pencil cursor on the Automobile class, press and maintain right click and drag it outside the class box. You should have now an arrow pointing to the Automobile class. Next to the arrow you should see "{disjoint, complete}" and the association number "Rx" as in the next figure:

Figure 12.1. Supertype/Subtype association - figure 1

Supertype/Subtype association - figure 1

For the subtype association select the "New Subtype" button (last button to the right) place the pencil cursor on the class Sport, press and maintain right click then drag it outside the class box. Release the mouse then place the cursor on the arrow that points to the Automobile class and right click once. Your class diagram should look like in next figure:

Figure 12.2. Supertype/Subtype association - figure 2

Supertype/Subtype association - figure 2

Do the same thing for the class Mini and your class diagram should look like in the next figure:

Figure 12.3. Supertype/Subtype association - figure 3

Supertype/Subtype association - figure 3