Your diagram has probably a couple of problems, because it says that for a competition (Wedstrijd
) there's only one Team
(composte aggregation) , which sounds neither competitive nor entertaining. Moreover it says that a club (Sportsverijn
) has at maximum one member, which doesn't fit with the narrative.
Once these problems solved (and a couple of others), and supposing that a Wedstrijd
involves two teams, you may add constraints to your model to express these complex conditions.
Typically, you would express them between curly braces, in plaintext: { cannot be referee for a match involving the relevant team }
next to the association between the match (Wedstrijd
) and the referee (Scheidsrechter
). This natural language constraint is ambiguous. A more formal expression could be written in OCL, something like: match.team->includes(match.referee.team) == false
The details of the expression will of course depend whether your model is a snapshot (seems to be the case here), or if it takes into account the fact that referees may change team in time. Here I have an alternative model that avoids composite aggregation and that associates referees to teams, with two examples of constraints:
