What is UML Inheritance?
UML Inheritance – a Central Concept of Object Orientation
Inheritance is a central concept of the Unified Modeling Language (UML) and is used in the design of classes and the modeling of class diagrams. A class consists of a collection of attributes and methods that determine the state and behavior of its instances. Using inheritance, attributes and/or methods of one class are passed on to another class. The inheriting class is called the base class – alternatively also as super class or parent class – and the inheriting class as derived class – or as child class or sub class.
The relationship between the base class and the derived class is permanent. A derived class can extend the list of attributes and methods and redefine methods if the modifiers of the base class allow it. This means that a new class can be an extension or a restriction of the original class. If a derived class inherits from more than one base class, it is called a multiple inheritance.
The Generalisation Hierarchy
A base class can also be seen as a generalisation of its derived classes, since its attributes and methods define the commonalities of all derived classes. In this context, the term generalisation hierarchy is also used. A similar term in this context is the inheritance hierarchy, which is often used in the context of the collection of requirements and in system structuring. However, deep inheritance hierarchies must be avoided, as they strongly link corresponding classes and the code they contain.
In UML, an inheritance relationship is represented by an arrow with a triangular tip pointing from the derived class to the base class. Inherited attributes and methods are not repeated in the representation of the derived class.
For a comprehensive description of inheritance, including examples and special features, check here »
Here you will find additional information from our Smartpedia section: