Inheritance
Inheritance is a feature that allows creation of a class that inherits the properties and relationships from a previously defined class. A class that inherits from another class is called a subclass. The class that the subclass “inherits from” is called the superclass.
A subclass will contain all the properties of the class(es) it inherits from. In Figure 3:
A class can only inherit directly from one class, but the class it inherits from can have up to four superclasses. So a class can have up to five superclasses: the class it directly inherits and the superclasses of that class.
Figure 3: Class Inheritance of PropertiesA class also inherits all the relationships of its superclasses.
Figure 4 shows a relationship called RelAM that has the origin class of ClassA and the destination class of ClassM. All classes that inherit from ClassA and ClassM also inherit this relationship. This means that ClassB and ClassC objects can be origin objects in this relationship and ClassN and ClassO objects can be destination objects. As shown in Figure 4, you can add a ClassM, ClassN or ClassO object to the destination collection of a ClassA, ClassB or ClassC object.
Figure 4: Class Inheritance of Relationships