next up previous index
Next: Restrictions Up: The object model Previous: The object model

Inheritance

  Many features are common to two or more classes. For instance, the ability to consult an attribute position in the source file in terms of line and column number is common to all nodes.

Rather than duplicating such features in all classes where they might be useful, inheritance is used to factorize them in   base classes. Then, classes can extend existing classes by inheriting from them, and add specific features in addition to the existing features.

Inheritance as supported by RainCode is strictly equivalent to inheritance as supported by common object-oriented languages such as Eiffel, C++ or Java.