Progress
ADM 2 Guide
Super Procedures
All of the support code for an object type, other than the code in its primary include file, is in a separately compiled super procedure that is built as a structured
.p
file. For example, the super procedure for SmartDataViewers isviewer.p
.During startup, the
.p
file is run and established as a super procedure for each of its SmartObjects running in that session. Its routines use TARGET–PROCEDURE to get the procedure handle of the appropriate SmartObject and can then get property values from that procedure to get handles or other data needed to act on behalf of the SmartObject. These SmartObjects can run any internal procedure or function implemented in one of the object’s super procedures as if it were implemented in the SmartObject itself. This allows these separately compiled procedure objects to do the following:For an overview of super procedures, see the Progress Programming Handbook. For descriptions of super procedures and TARGET–PROCEDURE, see the Progress Language Reference.
Figure 5–1 illustrates this relationship.
Figure 5–1: Super Procedures and Master Interactions
![]()
The
smart.p
code uses TARGET–PROCEDURE to reference the two masters. Formaster1.w
, the xyz procedure in thesmart.p
super procedure is run becausemaster1.w
does not have its own xyz procedure. Formaster2.w
, its own xyz procedure is run and then, because it executes RUN SUPER, the xyz procedure insmart.p
is also run.As this example illustrates, using super procedures to provide most of the support code for a SmartObject provides these advantages:
Each super procedure must define a getpropname function for each object property that can be retrieved from objects of that type and a setpropname function for each settable property. For more information on these properties, see the "Get and Set Functions for Object Properties" section.
Note that super procedures are not SmartObjects in themselves and are not directly seen or manipulated in the AppBuilder during application assembly. They do not have SmartLinks nor do they have properties of their own.
The super procedures for SmartObjects are designed to be shared and stateless. This means that a given super procedure such as
viewer.p
is run only once in a session. No matter how many SmartDataViewers there are, each SmartDataViewer designates the same instance ofviewer.p
as its super procedure. This means that whenever a routine is invoked inviewer.p
as a super procedure, it queries whatever properties of its TARGET–PROCEDURE are needed for it to act. The next routine invoked inviewer.p
is not assumed to come from the same TARGET–PROCEDURE.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |