Creating link in object model diagrams
To create a link, there must be at least one association that connects one of the base classes of the type of one of the objects to a base class of the type of the second object.
Procedure
- Click the Link tool.
- Click the first object.
- Click the second object.
- If wanted, name the link and press Enter.
Results
The new link is created in the diagram, and is displayed in the browser under the Link category. You can drag-and-drop links in the browser to other classes and packages as needed; however, you cannot create links in the browser.
The following figure shows links in an object model diagram. Notice that links shown in dark green to distinguish them from associations, which are drawn in red. In addition, the names and multiplicity of links are underlined.
By default, the role name and multiplicity of a link are not displayed. Right-click the link and select Display Options to select the items you want to display.
Note the following behavior:
- Links can be drawn between two objects or ports that belong to objects. One exception is the case when a link is drawn between a port that belongs to a composite class and its part (or a port of its part).
- When drawing a link, the product finds the association that can be instantiated by the newly drawn link and automatically maps the link to instantiate the association.
- If you draw a link between two objects with implicit type and there no associations to instantiate, the product automatically creates a new, symmetric association.