Is OCL meant to be used in combination with a composite structure diagram?
Or does it not make sense? If it makes sense, could someone give a quick example for a possible OCL constraint, e.g. based on this example diagram source ?
Is OCL meant to be used in combination with a composite structure diagram?
Or does it not make sense? If it makes sense, could someone give a quick example for a possible OCL constraint, e.g. based on this example diagram source ?
UML specifically mentions such situation (section 7.6. of specs)
Constraints themselves can be attached to any kind of UML Element
, or in fact a collection of Elements.
And finally:
7.2.1
The root concepts of Element and Relationship provide the basis for all other modeling concepts in UML.
Which means that you can add constraint to anything.