In class diagrams, an owned element association relationship is a type of association that dictates ownership.
The owned element association represents classes that are owned by another class. This relationship is used to visualize nested classes in a class diagram where a class is declared within the scope of another, outer, class. A nested class belongs to the namespace of the outer class and can only be used in the outer class. That is, the parent class declares the inner, or nested, class. This construct is primarily used for implementation reasons.
A declaring class and a class in its namespace are connected by an anchor line which is referred to as owned association in the UML model, with an anchor icon on the end connected to a declaring class. An anchor icon appears as a plus sign inside a circle.
For example, if Class B is attached to Class A by an anchor line with the anchor symbol on Class A, then Class B is declared within the Namespace of Class A. That is, the relationship between Class A and Class B is the namespace-owned element association.
The following table illustrates the relationship of Owned element association.
C/C++ source code | UML visualization |