2

I am designing an E-R Diagram for a simple system where there are some users and contests. A user can create a contest or invite other users to the contest who can decide to accept or not.

I am wondering if it is possible to model this in an E-R using a recursive diagram since a user can invite an other user mixed together with the contest since the invitation is linked to a certain contest.

Does it make sense? Or what would be the alternatives?

Image with my E-R:

enter image description here

2

Your model does not correspond to your narrative. It says:

  • A user can create a contest
  • A user can invite another user to a contest. The inviting user doesn't need to be the creator. He/she doesn't even be invited him/herself.

If you want that the creator only can invite users, you should make invitation a binary relation between contest and the invited user, being understood that the invting user is the creator of the contest.

Now, if you want that the creator and the already invited users (or a group of responsible users) can send invitations, you could think of the ternary relation.

Except that Recursive relationship are in principle unary. And ternary relations are making diagrams difficult to read (especially when cardinality is added). Furthermore, they often reveal themselves as the symptom of a hidden entity. The fact that you name the association Invitation rather than Invite only reinforces this impression.

You would significantly increase the clarity of your model with the following alternative:

  • An entity Invitation
  • A relation invites to between Invitation and contest
  • A relation sends between User and Invitation
  • A relation receives between User and Invitation
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.