mechanism for multiple inheritance can be quite problematic as it has to provide a way
of dealing with conflicts that arise when the superclasses contain the same attributes or
methods. Not all object-oriented languages and DBMSs support multiple inheritance as
a matter of principle. Some authors claim that multiple inheritance introduces a level of
complexity that is hard to manage safely and consistently. Others argue that it is required
to model the ‘real world’, as in this example. Those languages that do support it, handle
conflict in a variety of ways, such as:
n Include both attribute/method names and use the name of the superclass as a qualifier.
For example, if bonus is an attribute of both Manager and SalesStaff, the subclass
SalesManager could inherit bonus from both superclasses and qualify the instance of
bonus in SalesManager as either Manager.bonus or SalesStaff.bonus.
n Linearize the inheritance hierarchy and use single inheritance to avoid conflicts. With
this approach, the inheritance hierarchy of Figure 25.6 would be interpreted as:
SalesManager → Manager → SalesStaff
or
SalesManager → SalesStaff → Manager
With the previous example, SalesManager would inherit one instance of the attribute
bonus, which would be from Manager in the first case, and SalesStaff in the second case.