Search code examples
ruby-on-rails-4many-to-manyumlternary

UML ternary and reflexive association together


Using UML, I want to create the relation between : table user ( the user could be Buyer or Seller) and table job.

The buyer could leave feedbacks to seller and vice versa.

So, my approach is the following:

  • Reflexive relation between table user (buyer or seller)
  • Ternary relation between table user and table job
  • Association relating to ternary relation

Please find enclosed the following attemp: enter image description here

I need yours helps to know if is this correct or not ?

IF YOU HAVE ONOTHER CONCEPTION TO RELATE THESE TABLES DON'T HESITATE.


Solution

  • You have two associations between your ternary and your User class, one association with the Job class and a dependency on the Feedback class: this is definitely not a ternary.

    MCD and MLD are two abbreviations for Merise diagrams (largely used in France in the 90's, have a look at the French Wikipedia), this is not UML compliant, here is why. These diagrams respectively represent a conceptual view and a logical (usually relational) view of the informations. Merise is not at all object-oriented, while UML is purely object-oriented.

    The alternative I propose you is to forget your ternary. I don't understand how you can introduce a reflexive relationship between User and User. In my mind you have a real Feedback class which has a relationship on the buyer (of type User) and the seller (also of type User). In a way, as an object representation your UML diagram should be close to the Merise logical diagram (MLD) you did not produced but coded. It would be something like that:

    enter image description here