Home > Enterprise >  Is it conventional to use verbs to describe relationships between classes in UML?
Is it conventional to use verbs to describe relationships between classes in UML?

Time:10-13

I've come across resources that depict UML diagrams with verbs like 'wrote' to describe how one class uses another. Does this convention exist in UML; is it overkill to add this convention to my designs?

ex:

enter image description here

CodePudding user response:

Yes, this is a common convention: the name over the association (Wrote) is the name of the association. You may add the solid triangle to show the order of reading.

But often the associations are shown without name, or without the triangle, if this information is not important for the understanding of the diagram. Adding this systematically in the diagram might make it more difficult to read and give a feeling of information overload. So, up to you to find the right balance in your specific case.

CodePudding user response:

Just trying to summarize a few experiences:

  • Using the name/triangle notation is often advantageous when working with business stakeholders. In that case the triangle is mandatory because without it can lead to confusion. Not so in the above example but it should be a modeling rule set in the domain.
  • Applying roles/multiplicities is practical when moving over to technical aspects. In that stage the label is not important any more as it can be guessed from the role names. So the best is to have diagrams for business people having just the labels/triangles and ones for techies containing roles/multiplicities.
  • If for any case you want both notations make sure that you have enough space to distinguish between labels and role names. That makes dense diagrams impossible.

Like in a Chinese Restaurant: if there's all you can eat please listen to your stomach.

  • Related