OOP – UML inheritance – Why is the arrow direction from subclass to the parent class?

In the above image, class B inherits class A. If B inherits all methods of A, shouldn’t the arrow go from A to B? In my opinion, if the arrow is from A to B, it will make more sense.

Is there any reason to say that the direction of the arrow is like this instead of the other way around? I would love to hear this explanation.
Thank you.

Edit: I know this is how UML is designed. According to UML rules, the above picture is true, but my question is why UML uses The arrow goes this way.

The reason is that in your case the B reference (or you are about to call ) There is no knowledge about B in AA, so there is no arrow from A to B, but the other way around.

UML entity diagrams are not about who “gets” what, but about who references/knows Who.

In the image above, class B inherits class A. If B inherits all methods of A, shouldn’t the arrow go from A to B? In my opinion, if the arrow is from A to B, it will make more sense.

Is there any reason to say that the direction of the arrow is like this instead of the other way around? I would love to hear this explanation.
Thank you.

Edit: I know this is how UML is designed. According to UML rules, the above picture is true, but my question is why UML uses The arrow goes this way.

The reason is that in your case B references (or you are about to call) there is no knowledge about B in AA, so there is no arrow From A to B, but the other way around.

UML entity diagrams are not about who “gets” what, but about who references/knows who.

Leave a Comment

Your email address will not be published.