Inheritance

Note that Inheritance is not available in Standard mode. It is available in Advanced and User Experience modes.

Classes and subclasses can inherit from other classes

The inheriting class is known as a subclass, and the class it inherits from is called its superclass. A subclass automatically inherits public and protected attributes and methods of its superclass. You can then add any extra required attributes and methods to the subclass. You can also override an inherited method if the subclass performs the same method differently.

In System Modeler, if the superclass has a presentation (GUI), the subclass inherits the interface. You cannot change the inherited interface in the subclass, but you can add to it.

A class can only inherit from another class with the same stereotype. That is, an Ispec can inherit from another Ispec, but an Ispec cannot inherit from a report.

The only exceptions to this rule are:

Subclasses always inherits methods from their superclasses, but these methods can be overridden if the subclass needs to behave differently to its superclass.