What does "subsets" mean in UML exactly?
The UML 2.5.1 specification does not define the keyword subsets very well. I found the following in section 6.4.2:
The constraint {subsets endA} means that the association end to which this constraint is applied subsets the association end endA.
Consider the following diagram:
Intuitively, I would think this means the following:
- A Person can be a member of zero or more Clubs.
- A Person can be the leader of at most one Club.
- If a Person is the leader of a Club, then he/she is also a member of the same Club.
- If a Person is the leader of a Club, then he/she can still be a member of other Clubs at the same time.
I wonder if statement 4 is correct. In a discussion with Jim L. in the comments under his answer to another question, Jim wrote
You can’t restrict the cardinality of a subset and still have an element of the superset that violates the restriction.
If I understand this well, if a Person is the leader of a Club, then he/she cannot be a member of another Club.
Is there some place in the UML specs that defines subsets better than what I found?
from Recent Questions - Stack Overflow https://ift.tt/3nffBgx
https://ift.tt/3zKOHST

Comments
Post a Comment