Search code examples
umlclass-diagram

Repeating an element on UML diagram


I have the class diagram with the class repeated on it twice. What does it mean?

For examle, model represents the tree of nodes. Parent node aggregates child-nodes. Are these diagrams mean the same?

UML. Class diagram

I have several options:

  1. The graphic element on diagram is a link to model element. So, rectangles with the same name refer to the same model element. Diagrams mean the same thing.
  2. The graphic element within the diagram presents the unique model element. So, there are two Node2 classes within the model, whatever did author meant.
  3. The graphic element within the diagram presents the unique model element. Two rectangles with the same name means two classes Node2, but it is not well-formed model.

Is it specified in the UML Standard?


Solution

  • Yes, this two diagrams are semantically the same. Both elements in second diagram are representing the same (one) class. You can see that in the specification of UML itself. When it would make difficult to connect some nodes (like Element or Classifier), it is repeated on the diagram.

    In other words, option 1 is correct.