Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of class-based ABL : Defining interfaces
 

Defining interfaces

An interface declares property, method, and event prototypes and certain related data definitions that must be implemented by a class that specifies the interface as part of its own class definition. ABL allows you to define an interface as a named block that always begins with the INTERFACE statement and always ends with the END INTERFACE statement. The source code for an INTERFACE statement appears only in a class definition file (.cls file type), and a class definition file can contain only one such INTERFACE statement. This statement defines the interface type name that other classes can use to identify this interface as one they intend to implement. (For more information on class definition files, see Class definition files and object type names.)
Note: A class definition file can define a single class or a single interface, but not both, in the same file.
The INTERFACE statement differs from the CLASS statement in that it does not support the inheritance of classes or the implementation of other interfaces, and by definition, it cannot be specified as FINAL. However, it does allow you to specify one or more other interface types (super interfaces) from which this interface inherits member prototypes. In this way, you can define an interface from a combination of members that it inherits and members that it defines. Properties, methods, and events are the only members you can define for an interface. These property, method, and event definitions are limited to defining prototypes that contain no executable code. Members of an interface are always PUBLIC. The only data that an interface can define are temp-tables and ProDataSets used to define parameters for the methods that it defines.
For information on using an interface type in ABL, see Using objecttypes. For more information on defining interfaces, see Defininginterfaces.
* Comparison with procedure-based programming