Release 10.1A: OpenEdge Development:
ADM and SmartObjects

> ## SmartObject file relationships

> Within the overall SmartObject class hierarchy, the class files described in the "General structure of a SmartObject" section relate to other files of the same type in certain very specific ways. These relationships establish what characteristics and properties a specific SmartObject type inherits. Figure 5–2, which is based on the SmartDataViewer, illustrates these relationships.

> Figure 5–2: Include file structure for SmartDataViewer

> In Figure 5–2, note the following:

> - The `smrtprop.i` file (lower left) defines an ADMProps temp-table that in turn defines the basic properties that apply to all SmartObjects. Each include file above the `smrtprop.i` file adds properties specific to the class with which it is associated. For details, see the "ADMProps temp-table and object properties" section.

> - The `viewer.w` file includes only `viewer.i`.

> - The `viewer.i` file includes `datavis.i`, because a SmartDataViewer is a data visualization object. It also includes `viewprop.i`, which includes the prototype include file `viewprto.i`.

> - The `datavis.i` file includes `visual.i` because a SmartDataViewer is a visual object. It also includes `dvisprop.i`, which includes `dvisprto.i`.

> - The `visual.i` file includes `smart.i`, because a visual object is a SmartObject. The `visual.i` file also includes `visprop.i`, which includes `visprto.i`.

> - The `smart.i` file includes only `smrtprop.i` (which includes `smrtprto.i`).

> When SmartObject code is preprocessed, the preprocessors limit the full expansion of the include files to exactly one branch of the class hierarchy, to avoid duplication of the SmartObject code.

> Each SmartObject type uses a different part of the class hierarchy (different branches), but the The tree for any SmartObject type always ends with `smart.i`.

> Figure 5–3 expands on Figure 5–2 to illustrate how super procedures are started.

> Figure 5–3: Super procedure schematic for SmartDataViewer

> In Figure 5–3, note the following:

> - The `smart.i` file starts `smart.p` (if it is not already running) and adds it as a super procedure for the SmartDataViewer. The `smart.p` file should be the top-level super procedure for all SmartObjects.

> - The `visual.i` file starts `visual.p`, if it is not already running, and adds it as a super procedure for the SmartDataViewer.

> - The `datavis.i` file then starts `datavis.p` (if it is not already running) and adds it as a super procedure for the SmartDataViewer.

> - The `viewer.i` file starts `viewer.p` (if it is not already running) and adds it as a super procedure.

> Note: The object’s own super procedure always must be added last. This is because super procedures are searched in last-in, first-out (LIFO) order, so the interpreter searches in `viewer.p` first for needed routines and in `smart.p` last. This ensures that more general behavior is executed last and more object-specific behavior is executed first.

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