Try OpenEdge Now
skip to main content
Object-oriented Programming
Getting Started with Classes, Interfaces, and Objects : Class definition files and object type names : Class definition file structure
 

Class definition file structure

The structure for coding the source file for a class or interface definition has the following general syntax.

Syntax

[ROUTINE-LEVEL-statement][[USING-statement]...]
{CLASS-statement|INTERFACE-statement}
    class-or-interface-definition
END-statement
Element descriptions for this syntax diagram follow:
ROUTINE-LEVEL-statement
A ROUTINE-LEVEL ON ERROR UNDO, THROW statement. This statement changes the default error handling for procedures, user-defined functions, methods, and constructors so that any error object that has been thrown to the routine block is passed up to the caller of the routine. This statement can appear before or after any USING-statement. For more information on this statement, see Raising and handling error conditions.
USING-statement
A statement that allows abbreviated references to other class or interface types within this class or interface definition, without having to specify the package in the class or interface type reference. You can specify multiple USING statements to make abbreviated references to class or interface types defined in different packages. This statement can appear before or after any ROUTINE-LEVEL-statement. For more information on this statement, see Referencing an object type name without its package.
CLASS-statement
A statement that begins a class definition by specifying its class type name and its relationship to implemented interfaces and other classes in its class hierarchy. For more information, see Defining classes.
INTERFACE-statement
A statement that begins an interface definition by specifying its interface type name. An interface is defined independently of and unrelated to any class, but it can inherit members from one or more other interfaces. For more information, see Defining interfaces.
class-or-interface-definition
Statements that are part of the class or interface definition. For user-defined classes, these statements define class members and other elements of the class definition. For user-defined interfaces, these statements define method, property, and event prototypes (and related data definitions) for methods, properties, and events that can later be implemented by user-defined classes. For classes, see Defining classes. For interfaces, see Defining interfaces.
END-statement
The statement that terminates a class or interface definition. For classes, see Defining classes. For interfaces, see Defining interfaces.