Duplicate members in a hierarchy
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Duplicate members in a hierarchy
Without interface inheritance, a class can implement more than one interface with multiple interfaces that include identical member signatures. In this case, the class is required to implement only one member that satisfies the identical signature in multiple interfaces.
With interface inheritance, the same rules apply. Multiple identical members appearing in different interfaces within the hierarchy are allowed and require only one implementation in the implementing class. Member types in the hierarchy that differ only by return type will generate compile time errors. Overloaded members may appear within the same interface, or in different interfaces within the hierarchy. This is comparable to existing rules with respect to overloading.
|
|
|
In the above example, it is allowed for interface IMyBottom to
have its own definition of the existing property, myInteger that
appears in IMyTop interface. Also, the class MyImplementation needs
to implement only the single property that satisfies them both.