In the UML, a Property is an association end and can be owned either by the association or by a participating Classifier, which is typically a class. When a Property is owned by a class, it's called an attribute. For example, an attribute Book::author
could get one of the following notations (where a dot should be drawn at the author association end of the right-hand side diagram):
The attribute could be used in constraint expressions like: self.author
or mybook.author->count()
This is straightforward for binary associations. But I have doubts how this works with ternary (or more generally N-ary) associations, for example:
Is it correct to state that Project
would have an attribute participant
and an attribute role
since these are the opposite member ends of the association?
And considering that participant
and role
are not independent, how to make use of their correlation in constraints, for example to refer to the contributors having a given role, or to the set of (participant,role)
-tuples to constrain its ->count()
to less than 10?