Search code examples
javaclassinterfaceclass-diagram

solid line arrow vs dotted line arrow in class hierarchy diagram


I'm currently learning java collection. I have been shown a class hierarchy diagram of Set interface and its sub-interfaces and concrete implementation classes.

enter image description here

No explanation was provided for the meaning of solid line arrow and dotted line arrow.

Using my own judgement, I assumed that solid line arrow means extends, and dotted line arrow means implements, but is my assumption correct?

Is there any official documentation for meaning and usage of such symbols?


Solution

  • You tagged this as . If you search for "class diagram" the first hit will probably be Wikipedia, where it is explained:

    • Generalization/Inheritance
      It indicates that one of the two related classes (the subclass) is considered to be a specialized form of the other (the super type) and the superclass is considered a Generalization of the subclass.
      The UML graphical representation of a Generalization is a hollow triangle shape on the superclass end of the line (or tree of lines) that connects it to one or more subtypes.

    • Realization/Implementation
      In UML modelling, a realization relationship is a relationship between two model elements, in which one model element (the client) realizes (implements or executes) the behavior that the other model element (the supplier) specifies. The UML graphical representation of a Realization is a hollow triangle shape on the interface end of the dashed line (or tree of lines) that connects it to one or more implementers.

    It is also illustrated with this picture:

    enter image description here

    So yes, your assumption in your example was right: solid line means it extends the interface, and dashed line means it implements the interface.