Progress
ADM 2 Guide
ADMProps Temp–table and Object Properties
One mechanism that supports getting and setting many SmartObject properties is the ADMProps temp–table. An ADMProps temp–table is defined for each object; it defines all of the standard object properties for that object type.
Each SmartObject super procedure uses a Progress include file that defines its own set of properties, and each SmartObject type that uses that super procedure also includes the same list. For example, the super procedure
smart.p
defines functions and procedures that all SmartObjects use and is at the top of the hierarchy of super procedures. This procedure includessmrtprop.i
, which defines the basic properties that apply to all SmartObjects. It defines a preprocessor constant for each basic property and also puts a FIELD definition for that property in the ADMProps temp–table. In addition, all SmartObjects usesmart.p
as a super procedure and include the supporting include filesmart.i
. Thesmart.i
include file also includessmrtprop.i
, as well as addingsmart.p
as a super procedure.The smrtprop.i (1 of 2) file defines these properties:
If a preprocessor has a name of the form xppropname, you can access the associated property value directly from its property temp–table FIELD. The {get} and {set} pseudo-syntax uses this mechanism to optimize references to properties, primarily in super procedures. If it is necessary for either get or set to invoke the corresponding property function (because of some other action it performs), then the preprocessor constant is not defined for that property and references always go through the get and set functions. For more information on the {get} and {set} pseudo-syntax, see the "{get} and {set} Pseudo-syntax for Object Properties" section.
Now consider a SmartObject that is defined as a subclass of
smart.p
. For example, a SmartDataObject addssmart.p
as its first super procedure, and then addsquery.p
anddata.p
as the super procedures that define behavior specific to SmartDataObjects. Thedata.p
procedure includes the property include filedataprop.i
, which appends more basic values to the list already started bysmrtprop.i
and continued byqryprop.i
. Each property include file adds FIELD definitions to the ADMProps temp–table definition.The dataprop.i (1 of 2)
file defines these additional basic properties:
As this example shows, each SmartObject type appends more basic properties to the end of the existing list. The process of appending basic properties to the existing list can be nested to any number of levels of object definition. In this case, both the
data.p
super procedure for SmartDataObjects, and individual SmartObjects themselves, includedataprop.i
. Thedataprop.i
include file in turn includesqryprop.i
, which includessmrtprop.i
. Basic properties are then initialized in each corresponding object include file (such assmart.i
for all SmartObjects anddata.i
for SmartDataObjects). This initialization both allocates FIELDs for each basic property and, where appropriate, assigns specific initial values. Because these preprocessor values are included in both the super procedures and in master objects of the type, both have access to them. This allows a super procedure to retrieve a property value directly from the ADMProps temp–table of its TARGET–PROCEDURE, which is extremely fast, instead of using function calls.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |