Association classes

In Rational® XDE, you can create association classes to model additional information about association relationships. While you can model the same construct in the Rational UML modeling products, the implementation is different between the tools.

Association class model elements before import

In the screen captures later in this topic, the first figure represents XDE, while the second figure represents the same diagram or construct in the Rational UML modeling products after import.

In XDE, an association class between two classes is built from five model elements, as shown in the following figure: two end classes (A and B), an association between them (the solid line), the association class itself (AC), and the AssociatedClass relationship (dashed line) from the association to the association class (AC).

An example of an association class in the XDE diagram window and Model Explorer.

Association class model elements after import

After import, the association class construct has changed so that the association, the associated class (AC), and the relationship (dashed line) are represented by one single element: an AssociationClass element named AC. In UML 2.0, an AssociationClass element is both an association and a class, and it is displayed as both on diagrams. Several other important changes also take place during the import process:
  • Because multiple XDE elements are merged into a single UML 2.0 element, you have less control over the display of association classes on diagrams. For example, the characteristics of the dotted line connecting the association with the class, such as color and bend points, are not imported because there is no element in UML 2.0 to which those characteristics can be applied.
  • In most cases, the XDE class that is part of the association class is transformed into the UML 2.0 association class and no longer exists as a separate class. If the class and the association live in different models, the class is migrated separately and its contents are merely copied into the association class. The diagram in the following figure capture shows an example of the latter, where the class is copied rather than transformed.
  • If an XDE class uses a generalization relationship (as an association class) to connect to a regular class, the generalization relationship is migrated as a dependency relationship because an association class cannot specialize a regular class in UML 2.0.
Important: These screen captures reflect how the diagram imports when you select the Always retain XDE class option in the Import Options page of the XDE Model Import wizard. When you select this option, the XDE class imports as UML2 Class even though its contents are copied into the newly created UML 2.0 AssociationClass (which combines the Association and AssociatedClass relationships from XDE). If you select Retain XDE Class only if needed, the XDE association, class and AssociatedClass relationship import as a UML 2.0 AssociationClass (when the association and class reside in the same XDE model).
An example of an association class in the Rational modeling products diagram editor and Model Explorer view.
Note: Diagrams that contain association classes are more likely than other diagrams to require manual repositioning of elements and labels after migration. In this figure, the AC class created after import was manually moved from underneath the association class.

Feedback