Reputation: 263
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:
Upvotes: 3
Views: 5395
Reputation: 543
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.
Upvotes: 8