Use a waypoint shape to connect an association class in UML class diagrams

draw.io 13 Sep 2023

Share:

Association classes in UML class diagrams ‘hang’ off the relationship between two other classes. Instead of leaving an unconnected end on your connector, add a waypoint shape between them and connect all three class shapes to the waypoint shape.
Connect an association class in a UML class diagram in draw.io with a waypoint shape

Class diagrams are one of the most common and important type of UML diagram. The waypoint shape keeps your diagram organised and allows you to connect two (or more) connectors together.

Learn about UML class diagrams and how to create them in draw.io

Connect an association class

  1. Search for the Waypoint shape in the shape panel in draw.io.
    Search for the waypoint shape in draw.io

  2. Drag the waypoint shape onto the drawing canvas between your three classes.

  3. Drag connectors between each of the classes and this waypoint shape.
    If you are having trouble attaching a floating connector to the waypoint shape (the blue outline), hold down Alt+Shift as you drop the connector on the waypoint shape.
    Hold down Alt+Shift as you drop a connector on a shape to ensure it will attach as a floating connector

  4. Set the end arrow styles and enter labels as needed on each of the connectors. Note that association classes in UML use a dashed line.

Now, if you move any of the classes, you won’t lose that association connection to both of the classes.

When to use association classes

Association classes store additional information about the relationship between two classes - the characteristics stored in the association class belong to the relationship itself and not the two related classes.

For example, the Enrolment association class contains the extra information that only exists when a student enrols in a course - their chosen semester and their grade.
Connect an association class in a UML class diagram in draw.io with a waypoint shape

UML association classes can contain operations, attributes, and other associations, just like normal UML classes.

It’s good practice to ensure that every instance of an association class should have a unique source and target pair of classes.

Other types of UML diagrams

There are many different types of UML diagrams used to describe both the structure and the behaviour of complex systems and processes.

Diagram types defined in UML 2.5

See how you can create the following UML diagrams in draw.io.

Follow us on GitHub, Twitter, Facebook.

Share: