Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML diagram inheritance

I have a UML diagram of a program that I am trying to assemble, and I am not sure how to mark that a method needs to be rewritten in child class. Do I rewrite the name in the child class diagram, or do I just leave it and say so in the documentation?

Here is the picture of the diagram: UML diagram trying to assemble

like image 614
Mark Avatar asked Oct 17 '25 18:10

Mark


1 Answers

If the method needs to be overridden (=rewritten) in the subclass, mention the name of the method in the subclass.

If you don't want to override the method, then don't mention it in the subclass. The method will be inherited from the superclass.

Optionally, when overriding a method, you can add '{redefines}' as a note behind the method. I'm not sure if this is mandatory. I would add a note if it makes things more clear to you. Also check out the possibilities of the UML tool you are using. There might be an option to add a 'redefines' -like comment to a method.

like image 168
Rolf Schorpion Avatar answered Oct 20 '25 08:10

Rolf Schorpion