Use interface hierarchies
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
A class implementing an interface hierarchy does so in the same manner as a regular single interface. To the implementing class, the extended interface acts as a meta-interface that encapsulates all of the members of the interface hierarchy. This enhances the ability to implement more advanced interface polymorphism. You can implement any of the interfaces in the hierarchy.
For example:
|
|
|
In the above example, three interfaces, ISedan, ICoupe,
and IPickup inherit from the existing interfaces.
The following figure depicts the interface hierarchy where interface ISedan, ICoupe,
and IPickup inherits member prototypes from the
existing interfaces IVehicle, ICar,
and ITruck.

The three classes that implement each extended interface are:
|
|
|
An application making use of these types can choose to program to the interfaces via polymorphism.
For all three classes, both the function TYPE-OF and the Progress.Lang.Class method IsA( ) will
return true for IVehicle. The first two, Altima and Mustang,
will both return true for ICar. Class Tundra will
return true for IPickup.
|
The above example is of a client programming to the interfaces.
All the three classes are valid as parameters to this method. The
first two is passed into handleCar( ) method,
while the third is passed to handleTruck( ) method.