Chapter 3 Building Structural Diagrams


Instance Links (OOM)

An instance link represents a connection between two objects. It is drawn as a solid line between two objects.

An instance link can be created in the following diagrams:

Instance links in an object diagram

Instance links have a strong relationship with associations of the class diagram: associations between classes, or associations between a class and an interface can become instance links (instances of associations) between objects in the object diagram. Moreover, the instance link symbol in the object diagram is similar to the association symbol in the class diagram, except that the instance link symbol has no cardinalities.


The roles of the instance link are duplicated from the roles of the association. An instance link can therefore be an aggregation or a composition, exactly like an association of the class diagram. If it is the case, the composition or aggregation symbol is displayed on the instance link symbol. The roles of the association are also displayed on the instance link symbol provided you select the Association Role Names display preference in the Instance Link category.

Example

The following figure shows Object_1 as instance of Class_1, and Object_2 as instance of Class_2. They are linked by an instance link. It shows Class_1 and Class_2 linked by an association. Moreover, since Class_2 is associated with Class_1 and also inherits from Class_3, there is an association between Class_1 and Class_3.

The instance link between Object_1 and Object_2 in the figure can represent Association_1 or Association_2.


You can also use shortcuts of associations, however you can only use it if the model to which the shortcut refers is open in the workspace.

Instance links behavior

The following rules apply to instance links:

Instance links in a collaboration diagram

An instance link represents a connection between objects, it highlights the collaboration between objects, hence the name 'collaboration diagram'. It is drawn as a solid line between:

An instance link can be an instance of an association between classes, or an association between a class and an interface.


The role of the instance link comes from the association. The name of an instance link comprises the names of both objects at the extremities, plus the name of the association.

The symbol of the instance link may contain several message symbols attached to it.


Instance links hold an ordered list of messages. The sequence numbers specify the order in which messages are exchanged between objects. For more information, see the "Messages" section in the "Building Dynamic Diagrams" chapter.

Instance links behavior

The following rules apply to instance links:

 


Copyright (C) 2006. Sybase Inc. All rights reserved.