Benefits of interfaces
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
An interface class is like a template that developers can use to help standardize
how a set of classes are defined. An interface class defines the PUBLIC
data members and methods required for a set of classes. PUBLIC data
members can include temp-tables, datasets, or properties, but not variables.
Defining and developing a class that uses an interface class includes a number of tasks:
-
Define the interface class that will be used by the class.
-
Define the class using the interface class.
-
Implement the constructors, methods, and destructor of the class.
Note: An interface class is not a superclass in an inheritance
hierarchy. It is simply a way to provide a standardized template for how a set
classes are to be implemented. These classes do not need to be part of a specific
hierarchy. Because classes that are based on an interface class, do not inherit from
the interface class, all members of the interface class must be
PUBLIC.