Flattening Interfaces

Meta Data Services Programming

Meta Data Services Programming

Flattening Interfaces

You can use derived members to flatten a set of interfaces of a class into a single interface. In this case, the new interface contains all of the combined members of the flattened interfaces. This simplifies the use of the class, because your application does not need to navigate between interfaces of the class.

In the following figure, an object exposes two interfaces, I1 and I2, whose members are M1 and M2. By delegation, the two interfaces could be flattened into one interface I3 that contains the derived members Md1 and Md2. In this case the call I3::Md1 will be mapped to I1::M1, and the call I3:Md2 will be mapped to I2::M2.

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

See Also

Creating a Derived Member

Derived Members

Interface Implication