Search code examples
language-lawyeruml

UML Class::nestedClassifier and Classifier::nestingClass


The composition association between Class and Classifier enclosed in the red rectangle in the diagram below (Figure 11.15 Classes from UML specification 2.5.1 on page 236) shows that the end nestingClass on the left is not navigable from Classifier. There is also no association end in the description for Classifier by that name; under "Association Descriptions", the association end is shown as being owned by the Association itself. nestingClass However, in the constraint specifications for Component on page 267, this property is queried by the constraint body for no_packaged_elements:

11.8.6.7 Constraints
...
no_packaged_elements
A Component nested in a Class cannot have any packaged elements.

inv: nestingClass <> null implies packagedElement->isEmpty()

Of course, it would be trivial to derive nestingClass from the owner relationship, but I am wondering why this composition association should not be navigable? The diagram above shows other compositions which are navigable. Is it perhaps an oversight?


Solution

  • The diagram doesn't tell that it's non navigable in the opposite direction. It tzls that the navigability in the opposite direction is not specified:

    • Navigable is shown with an open arrow head
    • Non navigable is shown with a cross across the association
    • No arrow head and no cross is therefore unspecified

    From this perspective there is no contradiction. Moreover, navigability is a run-time promise and not a structural feature. So if the navigability is unspecified, it just tells that the verification of that constraint by the modelling tool, may or may not, be efficient. If the non-navigability would be explicit, it would just mean that the verification of the constraint would not be time efficient, not that it's impossible.