Try OpenEdge Now
skip to main content
Object-oriented Programming
Getting Started with Classes, Interfaces, and Objects
 

Getting Started with Classes, Interfaces, and Objects

The basic unit of executable code for object-oriented programming is the object, which encapsulates a specific set of state and behavior according to its type. The primary mechanism for defining the type of an object is the class, which specifies the class members for an object and its relationship to other classes. Typically a single object is defined by a hierarchy of classes. Thus, referencing an object by a given class type in its class hierarchy allows you to access all of the public class members defined by that class type and the super classes above it in the class hierarchy.
You can also define interfaces for objects. An interface represents a type that declares method, property, and event prototypes that any class implementing the interface must define. Thus, an interface type allows multiple classes to implement behavior according to the shared contract specified by the interface. You can then reference any instance of these classes as an interface type to access the class-specific implementation of a given interface-declared property, method, or event.
You can manage the implementation of an application using the class hierarchies and interfaces that define your objects.
Note: As of version 11.6, the ABL also supports enumerations, or enums. An enum is made up of a list of strongly typed, named constants called members. The value of a variable defined as an enum is restricted to the list of members defined for that enum. Enums are implicitly class based, so you can use them in many of the same ways you use a class type or instance. For more information, see the DEFINE ENUM entry in OpenEdge Development: ABL Reference.
* Class definition files and object type names
* Defining classes
* Using the CLASS construct
* Defining interfaces
* Using the INTERFACE construct
* Managing the object life-cycle