Simulating Multiple Inheritance

Meta Data Services Programming

Meta Data Services Programming

Simulating Multiple Inheritance

In COM, multiple inheritance between interfaces is not supported. However, by using the derived members capability, multiple inheritance can be simulated.

For example, the following figure shows an interface IA that inherits from IB, and implies IC (meaning that any class that supports IA must also support IC). According to COM, IA cannot inherit from IC because it already inherits from IB. However, with delegation, the members of IC could be made available on IA. This is not inheritance, because IC members are not explicitly mapped into IA. Nevertheless, the result is the same because IA now includes members of both IB and IC.

For more information about other ways of combining interface members, see Flattening Interfaces and Supporting Multiple Interfaces With Overlapping Functionality.

See Also

Creating a Derived Member

Derived Members

Interface Implication