Association

An association describes a set of tuples whose values refers to typed instances. An instance of an association is called a
link.

Description

An association specifies a semantic relationship that can occur between typed instances. It has at least two ends
represented by properties, each of which is connected to the type of the end. More than one end of an association may
have the same type.

When a property is owned by an association it represents a non-navigable end of the association. In this case the property
does not appear in the namespace of any of the associated classifiers. When a property at an end of an association is
owned by one of the associated classifiers it represents a navigable end of the association. In this case the property is also
an attribute of the associated classifier. Only binary associations may have navigable ends.

Attributes

Associations

memberEnd : Property [2..*] Each end represents participation of instances of the classifier connected to the end in
links of the association. This is an ordered association. Subsets Namespace::member.
ownedEnd : Property [*]  The non-navigable ends that are owned by the association itself. This is an ordered associ-
ation. Subsets Association::memberEnd, Classifier::feature, and Namespace::owned-
Member
.
/ endType: Type [1..*] References the classifiers that are used as types of the ends of the association.

Constraints

  1. An association specializing another association has the same number of ends as the other association.

    self.parents()->forAll(p | p.memberEnd.size() = self.memberEnd.size())

  2. When an association specializes another association, every end of the specific association corresponds to an end of the
    general association, and the specific end reaches the same type or a subtype of the more general end.
  3. endType is derived from the types of the member ends.

    self.endType = self.memberEnd->collect(e | e.type)

Semantics
An association declares that there can be links between instances of the associated types. A link is a tuple with one value
for each end of the association, where each value is an instance of the type of the end.
When one or more ends of the association have isUnique=false, it is possible to have several links associating the same
set of instances. In such a case, links carry an additional identifier apart from their end values.
When one or more ends of the association are ordered, links carry ordering information in addition to their end values.

For an association with N ends, choose any N-1 ends and associate specific instances with those ends. Then the collection
of links of the association that refer to these specific instances will identify a collection of instances at the other end. The
multiplicity of the association end constrains the size of this collection. If the end is marked as ordered, this collection
will be ordered. If the end is marked as unique, this collection is a set; otherwise it allows duplicate elements.

An end of one association may be marked as a subset of an end of another in circumstances where (a) both have the same
number of ends, and (b) each of the set of types connected by the subsetting association conforms to a corresponding type
connected by the subsetted association. In this case, given a set of specific instances for the other ends of both
associations, the collection denoted by the subsetting end is fully included in the collection denoted by the subsetted end.

An end of one association may be marked as redefining an end of another in circumstances where (a) both have the same
number of ends, and (b) each of the set of types connected by the redefing association conforms to a corresponding type
connected by the redefined association. In this case, given a set of specific instances for the other ends of both
associations, the collections denoted by the redefining and redefined ends are the same.

Associations may be specialized. The existence of a link of a specializing association implies the existence of a link
relating the same set of instances in a specialized association.

The semantics of navigable association ends are the same as for attributes.

For n-ary associations, the lower multiplicity of an end is typically 0. If the lower multiplicity for an end of an n-ary
association of 1 (or more) implies that one link (or more) must exist for every possible combination of values for the other
ends.

An association may represent a composite aggregation (i.e., a whole/part relationship). Only binary associations can be
aggregations. Composite aggregation is a strong form of aggregation that requires a part instance be included in at most
one composite at a time. If a composite is deleted, all of its parts are normally deleted with it. Note that a part can (where
allowed) be removed from a composite before the composite is deleted, and thus not be deleted as part of the composite.
Compositions define transitive asymmetric relationships--their links form a directed, acyclic graph. Composition is
represented by the isComposite attribute on the part end of the association being set to true.

Semantic Variation Points

The order and way in which part instances in a composite are created is not defined.

The logical relationship between the derivation of an association and the derivation of its ends is not defined.

The interaction of association specialization with association end redefinition and subsetting is not defined.

Notation

Any association may be drawn as a diamond (larger than a terminator on a line) with a solid line for each association end
connecting the diamond to the classifier that is the end's type. An association with more than two ends can only be drawn
this way.

A binary assocation is normally drawn as a solid line connecting two classifiers, or a solid line connecting a single
classifier to itself (the two ends are distinct). A line may consist of one or more connected segments. The individual
segments of the line itself have no semantic significance, but they may be graphically meaningful to a tool in dragging or
resizing an association symbol.

An association symbol may be adorned as follows:

Note that by default an association end represents a set.

A stick arrowhead on the end of an association indicates the end is navigable. A small x on the end of an association
indicates the end is not navigable. A visibility symbol can be added as an adornment on a navigable end to show the end's
visibility as an attribute of the featuring classifier.

If the association end is derived, this may be shown by putting a slash in front of the name, or in place of the name if no
name is shown.

The notation for an attribute can be applied to a navigable assocation end name.

A composite aggregation is shown using the same notation as a binary association, but with a solid, filled diamond at the
aggregate end.

Presentation Options

When two lines cross, the crossing may optionally be shown with a small semicircular jog to indicate that the lines do not
intersect (as in electrical circuit diagrams).

Various options may be chosen for showing navigation arrows on a diagram. In practice, it is often convenient to suppress
some of the arrows and crosses and just show exceptional situations:

Style Guidelines

Lines may be drawn using various styles, including orthogonal segments, oblique segments, and curved segments. The
choice of a particular set of line styles is a user choice.

Generalizations between associations are best drawn using a different color or line width than what is used for the
associations.

Examples

Figure 74 shows a binary association from Player to Year named PlayedInYear. The solid triangle indicates the order of

reading: Player PlayedInYear Year. The figure further shows a ternary association between Team, Year, and Player with
ends named team, season, and goalie respectively.

The following example shows association ends with various adornments.

The following adornments are shown on the four association ends in Figure 75.

The following examples show notation for navigable ends.

In Figure 76:

Figure 77 shows a navigable end using attribute notation. A navigable end is an attribute, so it can be shown using
attribute notation. Normally this notation would be used in conjunction with the line-arrow notation to make it perfectly
clear that the navigable ends are also attributes.

Figure 78 shows the notation for a derived union. The attribute A::b is derived by being the strict union of all of the

attributes that subset it. In this case there is just one of these, A1::b1. So for an instance of the class A1, b1 is a subset of
b, and b is derived from b1.

Figure 79 shows the black diamond notation for composite aggregation.