Progress
ADM 2 Guide


Adding Properties

When you extend the ADM, whether by creating a new class or by customizing an existing class, you define properties that support the special behavior of your class. If you are creating a new class, you define standard properties in the standard property file; if you are customizing an existing class, you define custom properties in the custom property file.

Within the relevant file, you define properties in the same way. The property definition section of these files appears near the end of the Main Block section of the file. It has the following format:

&IF "{&ADMSuper}":U = "":U &THEN
  ghADMProps:ADD-NEW-FIELD(prop-specs)
  ghADMProps:ADD-NEW-FIELD(prop-specs)
  ghADMProps:ADD-NEW-FIELD(prop-specs)
  .
  .
  .
&ENDIF 

When adding properties to the property file for a new or customized class, consider defining any properties that will be accessed frequently and for which the best possible performance is important as direct access properties. Properties are stored in the ADMProps temp–table; direct access properties are accessed directly from the temp–table rather than using get/set functions. The lack of function-call overhead can significantly improve performance.

You specify that a property is a direct access property by defining a preprocessor constant of the form xppropname for it. The preprocessor constant definition section is in the Main Block of the property file, just before the property definition section. The definitions have this format:

&GLOBAL-DEFINE xppropname 

Sometimes you might want to read or write a direct access property from outside its own class. However, the ADMProps temp–table can be accessed directly only from objects of its own class and super procedure. To work around this problem, you must define get and/or set functions (as needed) that can be called from outside the class but that internally access the required property directly. This special-purpose get function has the following format:

FUNCTION getpropname RETURNS LOGICAL
  ( ):
  DEFINE VARIABLE lpropname AS LOGICAL NO-UNDO.
   {get propname lpropname}.
   RETURN lpropname.
END FUNCTION. 

Its companion set function has the following format:

FUNCTION setpropname RETURNS LOGICAL
 (pxvariable AS data-type):
  {set propname pxvariable}.
  RETURN TRUE.
END FUNCTION. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095