Types of inheritance
Each item in the derived statechart can be:
- Inherited where any modification to an item in the superclass is applied to the item in the subclass.
- Overridden where any modifications to an item in the superclass do not apply to the subclass. However, deleting an item from the superclass also deletes the item from the subclass. This is different from C++, for example, where deleting an overridden behavior in the superclass causes the overridden behavior to become a regular item.
- Regular where regular items are owned by the subclass. The item is not related to the superclass and is not affected by the superclass.
Noting the status of items as inherited, overridden, or regular is crucial both for Rhapsody® and the user.
Note: The current implementation of statechart inheritance
is restricted to single inheritance. A reactive class can have at
most one reactive superclass.
Inheritance color coding
Inheritance status is indicated by the following color coding:
- Inherited items are gray.
- Regular and overridden items are colored in the typical drawing colors.