Reputation: 47
What is actual UML diagram of Hierarchical inheritance,In some of tutorials Arrows are pointing towards base class and some are pointing towards sub class.
I know Arrows point towards Base class always.
But wondering is there any special case in Hierarchical inheritance so that some tutorial have arrows are pointing downward.
Upvotes: 0
Views: 819
Reputation: 6318
As a reference you should take here the UML specification and it clearly states the generalization has an arrowhead pointing to the superclass (parent class). See Section 9.2.5. for a clear confirmation.
Both diagrams use a wrong type of arrows (it should be a solid line with a hollow triangle as an arrowhead) but in terms of direction the second one is correct assuming A is a superclass.
Upvotes: 3
Reputation: 2500
The first diagram is wrong, in my opinion.
According to the Wikipedia article generalization in UML 2.5 is expressed using arrows which are pointing from subclasses to the base class.
I also think that first picture doesn't show us interface realization because
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.
Someone can be very creative and will come up with a brand new standart and teach the standart in his/her tutorials, so I advise you to read something more professional. For example, it can be UML Distilled by Martin Fowler.
Upvotes: 0