Class properties
- Last Updated: November 8, 2021
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Like a variable, a property holds a value of a built-in type or
user-defined type, but it also has built-in accessor methods get() and set() that are used to access
the data in the property. This is useful because you can define a property to be read by
another part of the application, but only to be set by methods of the class. In
addition, you can add code to the get() and set() accessor methods to customize how the property value
will be read and set. For example, you can implement the set()
accessor method to transform a PostalCode value
into a standard format.
Note: A best practice is to define
properties as
PUBLIC for reading and PRIVATE or PROTECTED
for setting. PACKAGE-PRIVATE and PACKAGE-PROTECTED allow package-level protection. This
enables you to control how data is accessed by code from other parts of your
application. Most of the data members you add to an ABL class are defined as
properties.