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.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2781 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.