While the UML specification identifies many different relationships and possible sub-types, UMLBoard only uses a subset of them. This subset, however, should be suitable for most diagrams, associations, generalizations and dependencies.
In UMLBoard, associations can be split further into compositions and aggregations:
Use compositions to express that the lifetime of one class depends on its related type. E.g., suppose an
Orderclass has a composition relation to
OrderItems: If you delete the
Orderclass, all corresponding
OrderItemswill be deleted accordingly.
Aggregations describe a similar relation, but both elements of the connection can exist independently of each other. For example, a
Tiremight still exist if you delete the
Carto which it belongs (although this might depend on your use case).
If you're unsure about the concrete type of association (or it does not matter in your case), choose the more general and unspecified type association.
To specify a generalization relationship, UMLBoard provides the Inheritance or Implementation relation. The concrete type of generalization depends on the target class type. In the case of a class, the generalization will be Inheritance; in the case of an interface, it will be an Implementation. Changing the target class type will automatically change the kind of generalization.
Finally, the dependency relation is not further distinguished. If you need a more fine-grained dependency classification, you could use a meaningful description like «use», «create» or «call» for your relation's text.
Creating and Editing
To create a relationship between two classes, start by dragging one of the connection points that appear when you hover the mouse over a class rectangle onto the target class.
After releasing the mouse on the target, a dialog with the list of available relationships should appear. The available options might vary depending on your source and target class type.
The created link will have a predefined description depending on the chosen relationship type. You can change it by long-pressing or double-clicking the text. Right-clicking on the connection opens a context menu with additional editing options: Switching the Connections allows you to
UMLBoard will always draw an orthogonal connection path by choosing the least distant connection points as start and endpoints. The relation automatically updates if you move either the source or target element.
The automatic routing algorithm should work for most basic scenarios but can be limited regarding more advanced layouts. To provide extra guidance to the automatic routing, you can add additional anchor points to a line by pressing Cmd / Ctrl + Click while clicking on a connection line. When drawing a connection between two elements (classes or notes), the algorithm will now always ensure that the line also goes through all anchor points associated with the relation line.
Just click and hold the mouse to drag the anchor point to a different position and see the changes applied to the routing instantly. In that way, you can force the connection to take a specific direction or move around elements.
To delete an anchor point again, select it by clicking on it and press the Del or Backspace key.
Anchor points don't change their position if you move the source/end of a relation separately (but do if you move both source and target simultaneously). Therefore, adjusting the anchor points might sometimes be necessary after moving one of the connection's elements.
Choose and Lock Docking Points
Using anchor points to customize the routing is suitable for more complex scenarios. Still, it can be a bit cumbersome for more straightforward designs. Here, it is often sufficient to define which sides of an element should be used for docking the connection line.
For this, you have two possibilities:
- For new lines: While drawing a new connection, just drag its end directly on the connection point of the target element you wish your line to connect to.
- For existing lines: Drag the connection's end marker (the blue dot at the end of a line) and drop it onto an arbitrary connection point. In that way, you can also change the source/target element of a connector after creating it.
After that, the line's ending is locked to this specific point. The layout algorithm will no longer choose a different docking point, no matter where the source and target elements are placed. If you want to remove this constraint and enable auto-docking again, grab the line's end (the blue dot) and drop it directly over the element (and not over one of its docking points). The routing will then choose the docking point that guarantees the shortest connection between two elements.
Another way of locking/unlocking a line to a connection point is to right-click on the end indicator and choose the corresponding menu entry from the context menu.
Associations and Properties
Whether you want to express a relation as an association or through an attribute is totally up to you. You can even start one way and later convert it to the other. For doing so, click on your property/relation and choose the corresponding menu element. You can, of course, undo or revert your decision any time by executing the contrary menu element.
References and further readings