- i have three classes and each one of them has an association with same forth class, is it okey to use N-ary association in this case ?
Asked
Active
Viewed 1,324 times
1

Mohamed Hmini
- 81
- 9
-
Can you please show a screen shot of that part of your class diagram. – qwerty_so Mar 27 '18 at 18:54
-
1Your description is not precise enoug to fully understand the entities you're describing. Can you explain in more details the character of the relations? Maybe provide actual example? Short answer could be - yes, it's OK. But the real question I hear here is - is in my case N-ary association suitable. But the description you've provided is not enough to answer **that** question. – Ister Mar 27 '18 at 19:12
-
Possible duplicate of [UML ternary association](https://stackoverflow.com/questions/46917458/uml-ternary-association) – Geert Bellekens Mar 29 '18 at 07:54
1 Answers
0
It depends on the logic of your domain. If each of the three classes has a logically separate relationship with the fourth class (i.e. they can vary independently) then they are separate associations. If they are all associated by the same relationship then this would be N-ary. For example, a Car, Driver and Route could be all associated one relationship -- that you might call Journey -- which would be three-ended (N-ary), whereas a Car and an aggregate part (e.g. Wheel) would be two-ended. So it depends.

muszeo
- 2,312
- 9
- 13