[Ternary]
[Equivalency]
Hi guys, I need to know if this two connections are similar, i suspect they aren't but i am clueless about the reasons why. Much appreciated for any help ;D
[Ternary]
[Equivalency]
Hi guys, I need to know if this two connections are similar, i suspect they aren't but i am clueless about the reasons why. Much appreciated for any help ;D
Elaborating on qwerty_so's excellent answer:
The ternary association means that there there are links between Employee
, Projet
and Role
:
An Association declares that there can be links between instances whose types conform to or implement the associated types. A link is a tuple with one value for each memberEnd of the Association, where each value is an instance whose type conforms to or implements the type at the end.
Moreover:
When one or more ends of the Association have isUnique=false, it is possible to have several links associating the same set of instances. In such a case, links carry an additional identifier apart from their end values.
The set of binary associations say that there is a class Project_Participation
that has links with all the other classes. Since it's only binary associations, the links are pairs. However, using transitive closure, we can derive from the sets of pairs tuples combining the three classes. So the second model is at least as expressive than the first.
However, the two models are not completely equivalent. There are some subtle differences:
Project_Participation
could have properties and operations , whereas in the first model, this would only be possible if there the diamond would be an association class.From a practical perspective, both models would lead to a very similar implementation. Reverse engineering does in general not allow to distinguish both.
So yes, it's very similar. But not completely equivalent.
The diamond symbol anonymously binds the three connected classes and sets them into relation. Association classes are 2ary. The above is 3ary.
The lower picture gives the diamond a meaningful name and explains the diagram above just a bit better. There are also n-ary relations which obviously have n associations.