Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding why the extends arrow points in the opposite direction

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

like image 399
1.21 gigawatts Avatar asked Mar 22 '12 09:03

1.21 gigawatts


2 Answers

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).

like image 96
Christian Avatar answered Nov 04 '22 01:11

Christian


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.

like image 39
Alexander Shcheblikin Avatar answered Nov 04 '22 00:11

Alexander Shcheblikin