17.11. Association

An association on a class diagram represents a relationship between classes, or between a class and an interface.

Within the UML metamodel, Association is a sub-class of both Relationship and GeneralizableElement.

The association is represented as a line connecting actor and class or interface (see Figure 17.1, “Possible artifacts on a class diagram.”). The name of the association and any stereotype appear above the line.

[Caution]Caution

ArgoUML is restricted to binary associations at present. See Section 17.11.1, “Three-way and Greater Associations and Association Classes” for more on this.

Associations are permitted between interfaces and classes, but UML 1.3 specifies they must only be navigable toward the interface—in other words the interface cannot see the class. ArgoUML will draw such associations with the appropriate navigation.

Associations are often not named, since their meaning is obvious from the context.

[Note]Note

ArgoUML provides no specific way of showing the direction of the association as described in the UML 1.3 standard. The naming should attempt to make this clear.

The association contains two ends, which may be navigated to via the association property sheet. See Section 17.12, “Association End” for more information.

17.11.1. Three-way and Greater Associations and Association Classes

UML 1.3 provides for N-ary associations and associations that are governed by a third associative class. However, ArgoUML provides no support for neither at this stage.

17.11.2. Association Details Tabs

The details tabs that are active for associations are as follows.

ToDoItem

Standard tab.

Properties

See Section 17.11.3, “Association Property Toolbar” and Section 17.11.4, “Property Fields For Association” below.

Documentation

Standard tab. See Section 12.5, “Documentation Tab”.

Style

Standard tab.

[Note]Note

The values for the bounds of the Association appear to have no meaning. Changing them has no effect on the diagram. This is sensible behavior, given the association is tied to a particular actor and use case.

Source

Standard tab. You would not expect to generate any code for an association, and any code entered here is ignored (it will have disappeared when you come back to the association.

Constraints

Standard tab. ArgoUML only supports constraints on Classes and Features (Attributes, Operations, Receptions, and Methods), so this tab is grayed out.

Tagged Values

Standard tab. In the UML metamodel, Association has the following standard tagged values defined.

  • persistence. Values transitory, indicating state is destroyed when an instance is destroyed or persistent, marking state is preserved when an instance is destroyed.

  • derived (from the superclass, ModelElement). Values true, meaning the association is redundant—it can be formally derived from other elements, or false meaning it cannot.

    [Note]Note

    Derived associations still have their value in analysis to introduce useful names or concepts, and in design to avoid re-computation.

[Note]Note

The UML Element metaclass from which all other artifacts are derived includes the tagged element documentation which is handled by the documentation tab under ArgoUML

17.11.3. Association Property Toolbar

Go up

Navigate up through the package structure of the model. For an association this will be the package containing the association.

Delete

This deletes the selected association from the model.

[Warning]Warning

This is a deletion from the model not just the diagram. To delete an association from the diagram, but keep it within the model, use the main menu Remove From Diagram (or press the Delete key).

17.11.4. Property Fields For Association

Name

Text box. The name of the association. By convention association names start with a lower case letter, with “bumpy caps” used to indicate words within the name, thus: salesHandling.

[Note]Note

ArgoUML does not enforce any naming convention for associations.

[Tip]Tip

Although the design critics will advise otherwise, it is perfectly normal not to name associations on a class diagram, since the relationship is often obvious from the classes (or class and interface) name.

Stereotype

Drop down selector. Association is provided by default with the UML standard stereotype for Association ((implicit)) .

Stereotyping can be useful when creating associations in the problem domain (requirements capture) and solution domain (analysis), as well as for processes based on patterns.

The stereotype is shown between « and » below the name of the association on the diagram.

Navigate Stereotype

icon. If a stereotype has been selected, this will navigate to the stereotype property panel (see Section 15.4, “Stereotype”).

Namespace

Drop down selector. Records and allows changing the namespace for the association. This is the package hierarchy.

Association Ends

Text area. Lists the ends of this association. An association can have any number of ends, but in ArgoUML two is the only useful number (associative classes can lead to a third end on class diagrams, but this is not supported by ArgoUML). For more on association ends see Section 17.12, “Association End”.

The names of the association ends are listed, unless the association end has no name (the case when it is first created), in which case (anon AssociationEnd) is shown.

[Note]Note

The only representation of association ends on a diagram is that their name appears at the relevant end of the corresponding association.

Button 1 double click on an association end will navigate to that end.