Properties
- Last Updated: May 30, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Similar to ABL variables, properties in class
files maintain data or state. Like a data member in a class, a property
can be defined with an access mode (PUBLIC, PROTECTED, PRIVATE) that
determines where it can be read or updated. Properties are PUBLIC by
default.
But unlike ABL variables or class data members, properties can
be defined with a GET accessor and/or a SET accessor
for reading and writing a property's value, respectively. These
accessors, which are blocks of ABL statements, can contain code
which is executed when the property is read (GET)
or assigned (SET). If either the GET accessor
or the SET accessor is omitted, the property is
defined as write-only or read-only, respectively.
While there is no direct equivalent to properties in traditional ABL, properties can be simulated in persistent procedures, for example in the ADM2, by defining user-defined functions that control the reading and writing of an ABL variable.