18

In class diagrams I typically see something like ClassA extends ClassB where the arrow head points to ClassA. Example, here. This has always confused me. Why is the arrow head not pointing to ClassB?

enter image description here

General Grievance
  • 4,555
  • 31
  • 31
  • 45
1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231

2 Answers2

32

UML is simply used wrong in those diagrams. The arrow head must be a triangle (not an open one) it must point into the other direction and it is called realizes not implements. So if I did not entirely misinterpret the diagrams the author (of the diagram or of the software which created them) simply did not know how to use UML correctly.

In this diagram (just found by googling) you can see a correct visualization of a class "SearchService" realizing (implementing) the interface "SiteSearch".

Interface Realization

In the next diagram several classes are generalized by (specialize, extend) the class "Account".

Generalization

On this site you can get an overview (looks correct on the first glance). If you want to be sure you should look into the specification (find pdf download there).

Christian
  • 13,285
  • 2
  • 32
  • 49
  • Why is it called it realizing and generalizing? – 1.21 gigawatts Mar 23 '12 at 13:55
  • 1
    The authors of UML tried to use more general terms. And "implements" could be confused with the implementation of a UML model in a programming language. While "extending" is not always true for UML. A more general class can even be restricted by a subclass. – Christian Mar 28 '12 at 09:33
  • In the same diagram what is the correct term to describe the relationship Client has with the Visitor and Element objects? – emeraldjava Jan 30 '14 at 10:15
  • err, well that's incorrect UML again, I'm afraid. It should be a simple arrowhead like -> not a filled one to depict an association which is navigable in only one direction (also called reference). I should have sought longer for a nice diagram... – Christian Jan 30 '14 at 10:53
  • what about relationship of client-element? that arrow is filled and not dashed line – Ewoks Oct 27 '17 at 09:28
  • Well, I should have painted a diagram myself... the filled arrow should be an association, but an association must be denoted by an unclosed (unfilled) arrow like -->. – Christian Oct 27 '17 at 13:09
  • I have removed the flawed diagram. Have a look at the "this site" link to see correct visualizations of Associations. – Christian Oct 27 '17 at 13:23
  • Dang. did it exactly backwards. Thanks! – Chris Walker Apr 04 '20 at 23:15
3

I think the confusion here crops up out of the variations in the way people relate to the subtleties of English grammar.

Some people may be inclined to complete the "inconvenient" but UML-standard token "extend" as "extends", while others will complete it as "extended" when viewing or designing a diagram. Hence the differences in interpretation.