INTERFACE statement
- Last Updated: October 30, 2020
- 4 minute read
- OpenEdge
- Version 12.2
- Documentation
INTERFACE statement
Syntax
This is the syntax for defining an interface:
|
Element descriptions for this syntax diagram follow:
- interface-type-name
- The object type name for the interface definition is specified
using the following syntax:
[ " ][package.]interface-name [ " ]- package
- A period-separated list of string components that comprise a package name that, along with interface-name, uniquely identifies the interface among all accessible classes and interfaces in your application environment.
- interface-name
- The interface name, which must match the filename of the class file containing the interface definition.
For more information on this syntax, see Define and reference object type names.
For an interface definition, if the interface is defined in a package, you must specify package, even if the class definition file contains a
USINGstatement that specifies the fully qualified object type name for the interface or its package. For more information, see Reference an object type name without its package. - INHERITS super-interface-name[ , super-interface-name] ...
- One or more interfaces that the definition for interface-type-name inherits. The property, method, and event prototypes defined by each super-interface-name thus become part of this interface definition, and multiple occurrences of the same super-interface-name or member prototype in the interface hierarchy are treated as a single occurrence. However, you can never specify interface-type-name as an inherited interface. In other words, there can be no cycle in an interface inheritance hierarchy (recursive inheritance). Otherwise, ABL raises a compile-time error.
- temp-table | ProDataSet
- A static temp-table or ProDataSet definition. The interface
must supply temp-table and ProDataSet definitions for any temp-tables
and ProDataSets used as parameters to methods defined for the interface. These
are data definitions only. Such temp-table or ProDataSet definitions
cannot specify the
STATICoption. The class that implements this interface must define an instance data member that matches each data definition in the interface. These temp-table or ProDataSet definitions cannot be inherited from a super interface; they are private to and apply only to the members of the interface in which they are defined. - property
- A property interface prototype. Each property prototype is declared by
a single
DEFINE PROPERTYstatement, with one or both of theGETandSETaccessors specified, but with no accessor implementations. This means that appropriate access mode and data type information is specified for each accessor, but the accessor code block must be empty. All interface properties must be defined asPUBLIC, either explicitly declared or by default. These property prototypes cannot specify theINITIAL,STATIC,ABSTRACT, orOVERRIDEoptions. A property prototype has no storage allocated for it to hold an initial value and it can only be implemented as an instance property. - method
- A method interface prototype. Each method prototype is declared
by a single
METHODstatement with a signature, but with no implementation and noEND METHODstatement. All interface methods must be defined asPUBLIC, either explicitly declared or by default. These method prototypes cannot specify theSTATIC,ABSTRACT, orOVERRIDEoptions. A method prototype can only be implemented as an instance method. Method prototypes can be overloaded and can overload implemented method definitions. Note that interfaces cannot contain a constructor or destructor. - event
- A class event interface prototype. Each event prototype is declared by
a single
DEFINE EVENTstatement with a signature. All interface events must be defined asPUBLIC, either explicitly declared or by default. These event prototypes cannot specify theSTATIC,ABSTRACT, orOVERRIDEoptions. An event prototype can only be implemented as an instance event.