Override in UML
UML notation allows you to specify overridden properties and operations.
In many object-oriented programming languages, you can override a property or a method from the superclass. The overriding property/method in the subclass replaces the behavior of the property/method in the superclass.
The override in the UML classifier can be defined in two ways:
- implicit - you define a property or an operation with the same name in the subclass.
- explicit - you specify a redefinition for a property or an operation. The redefined operation looks like this: + MyOperation () {redefines MyOperation}
Example of Override in UML model
How to Specify Explicit Redefinition
If you want to use explicit redefinition to model the override using Software Ideas Modeler, you can do it this way:
- Right-click on an attribute (property) or an operation of the desired class in the diagram editor
- Choose Properties from the context menu
- Choose a property or an operation from the Redefines combo box
- Click on the OK button to confirm your setting
The redefinition refers to a property or operation in the superclass.
Set overridden operation using the Redefines parameter
New Comment