This feature allows creation of underlying items to construct an association in one step with some capability for reuse of existing items.
There is an Association line option on the Draw toolbar:
Draw the line. Connections are restricted by symbol type:
Name the line and press Enter in the usual fashion:
Press Escape and the process is canceled, the line is removed.
Otherwise:
If there are no conflicts (detailed later); if as in this case we have multiple options of type, the user is asked to select one:
Press Cancel and the process is canceled, the line is removed.
Otherwise, press OK and the definitions are created and linked.
The Association definition receives the name the user entered.
The intermediary relationship definitions (Properties in this case) receive the names <entered name>-<From item name> and -<To item name> respectively:
The relationship node symbol is placed in the middle of the line with the name in the default position above the symbol.
The line depiction is set in accordance with the line direction and whether the line is horizontal or vertical at the point where the relationship node symbol is placed.
A line point is inserted in the middle of the longest segment, so that the tool can determine how to set the direction property. Users can either move the node and reroute lines or just reposition only the name.
Users still need to define whether the properties are owned by the Association or the Class. They will probably want to rename them anyway.
Note Definitions can be left locked for a short period following this operation.
Drawing a another line between the same two nodes:
Enter no name or enter the same name as before and this happens:
Press Cancel and the process is canceled, the line is removed.
Press Yes and a report will be presented:
This has the benefit that users can select items to see details in the Property Pane, or double-click to open them.
The report will find multiple items, involving both Association and AssociationClass, for this Association example, but note that this is an exact name search if a name was specified:
As described in the message, if you select and then click-and-drag from the Name or Type association cells to the diagram, you cause the central node to be added and a restricted refresh is triggered which causes the lines to be added:
If you drop a node in a position not facilitating a vertical or horizontal line, you just get diagonal lines. The user can select them to force them to be routed:
(End of Yes selection.)
Replying No leads to a further verification as to whether the existing relationship definition should be reused:
Replying Yes will present report output:
Replying No leads to:
Replying No will create a new definition – because the items are GUID-keyed you get new, unique definitions which the user is free to rename.
Replying Yes will cause the user to be prompted to select the item to be updated. The user is only shown the name of the item.
In the scenario of creating a one-to-many relationship, so associating A with C after associating A with B causes creation of a duplicate association node symbol which should be removed to reduce the number of lines the next refresh for representational consistency will add.
It also creates a duplicate property for the reference because the existing A reference was already involved in an association and this scenario was not considered:
Running refresh results in this:
You can select lines and hide them to clear this up but the simplest thing to do is:
▪Remove the duplicate association node.
▪Remove (delete) the duplicated property called -A:
For an association drawn between classes A and B:
Where Properties exist that are owned by class A and reference class B and they are not part of an association, they are offered for selection.
Where Properties exist that are owned by class B and reference class A and they are not part of an association, they are offered for selection.
For example:
For any selected property they are added as an association member.