Previous UML Classes Table of Contents UML Packages Next


9.3.6 Connector

InternalStructures


   Specifies a link that enables communication between two or more instances. This link may be an instance of an association, or it may represent the possibility of the instances being able to communicate because their identities are known by virtue of being passed in as parameters, held in variables or slots, or because the communicating instances are the same instance. The link may be realized by something as simple as a pointer or by something as complex as a network connection. In contrast to associations, which specify links between any instance of the associated classifiers, connectors specify links between instances playing the connected parts only.

*Generalizations

   

    Feature (from Kernel ) on page 70

*Description

   Each connector may be attached to two or more connectable elements, each representing a set of instances. Each connector end is distinct in the sense that it plays a distinct role in the communication realized over a connector. The communications realized over a connector may be constrained by various constraints (including type constraints) that apply to the attached connectable elements.

*Attributes

   No additional attributes

*Associations

*Constraints

   [1] The types of the connectable elements that the ends of a connector are attached to must conform to the types of the association ends of the association that types the connector, if any.

   [2] The connectable elements attached to the ends of a connector must be compatible.

   [3] The ConnectableElement s attached as roles to each ConnectorEnd owned by a Connector must be roles of the Classifier that owned the Connector, or they must be ports of such roles.

*Semantics

   If a connector between two roles of a classifier is a feature of an instantiable classifier, it declares that a link may exist within an instance of that classifier. If a connector between two roles of a classifier is a feature of an uninstantiable classifier, it declares that links may exist within an instance of the classifier that realizes the original classifier. These links will connect instances corresponding to the parts joined by the connector.

Issue 8031 -Clarify destruction semantics.

   Links corresponding to connectors may be created upon the creation of the instance of the containing classifier (see StructuredClassifier on page 190). All such links corresponding to connectors are destroyed, when the containing classifier instance is destroyed.

   If the type of the connector is omitted, the type is inferred based on the connector, as follows: If the type of a role (i.e, the connectable element attached to a connector end) realizes an interface that has a unique association to another interface which is realized by the type of another role (or an interface compatible to that interface is realized by the type of another role), then that association is the type of the connector between these parts. If the connector realizes a collaboration (that is, a collaboration use maps the connector to a connector in an associated collaboration through role bindings), then the type of the connector is an anonymous association with association ends corresponding to each connector end. The type of each association end is the classifier that realizes the parts connected to the matching connector in the collaboration. Any adornments on the connector ends (either the original connector or the connector in the collaboration) specify adornments of the ends of the inferred association. Otherwise, the type of the connector is an anonymously named association with association ends corresponding to each connector end. The type of each association end is the type of the part that each corresponding connector end is attached to. Any adornments on the connector ends specify adornments of the ends of the inferred association. Any inferred associations are always bidirectionally navigable and are owned by the containing classifier.

*Semantic Variation Points

   What makes connectable elements compatible is a semantic variation point.

*Notation

    A connector is drawn using the notation for association (see Association (from Kernel ) on page 37). The optional name string of the connector obeys the following syntax:

   ( [ name ] ‘:’ <classname> ) | <name>

   where <name> is the name of the connector, and <classname> is the name of the association that is its type. A stereotype keyword within guillemets may be placed above or in front of the connector name. A property string may be placed after or below the connector name.

*Examples

    Examples are shown in StructuredClassifier on page 190.

*Changes from previous UML

   Connector has been added in UML 2.0. The UML 1.4 concept of association roles is subsumed by connectors.