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:


  • When an association between classes becomes an instance link, both classes linked by the association, and both classes of the objects linked by the instance link must match (or the class of the object must inherit from the parent classes linked by the association). This is also valid for an association between a class and an interface

  • Two instance links can be defined between the same source and destination objects (parallel instance links). If you merge two models, the Merge Model feature differentiates parallel instance links according to their class diagram associations

  • You can use reflexive instance links (same source and destination object)

Instance Links in a Communication Diagram

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


  • Two objects

  • An object and an actor (and vice versa)

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 Messages (OOM).

Instance Links Behavior

The following rules apply to instance links:


  • You can use a recursive instance link with an object (same source and destination object)

  • Two instance links can be defined between the same source and destination objects (parallel instance links)

  • When you delete an instance link, its messages are also deleted if no sequence diagram already uses them

  • When an association between classes turns into an instance link, both classes linked by the association, and both classes of the objects linked by the instance link must match (or the class of the object must inherit from the parent classes linked by the association). This is also valid for an association between a class and an interface

  • If you change one end of an association, the instance link that comes from the association is detached

  • When you copy and paste, or move an instance link, its messages are automatically copied at the same time

  • When the extremities of the message change, the message is detached from the instance link

  • If you use the Show Symbols feature to display an instance link symbol, all the messages attached to the instance link are displayed


Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com