skip to main content
OpenEdge Development: ADM and SmartObjects
Developing ADM Extensions : Introduction
In some circumstances when developing Progress 4GL applications that use SmartObjects, it is necessary or useful to create a new ADM class. Suppose, for example, you have several SmartDataBrowser master files that share some set of properties and/or behaviors beyond what is supported in the SmartDataBrowser as shipped, but that have other properties and/or behaviors that are unique to each master. You can create a new SmartDataBrowser template that includes the common functionality as standard behavior, and then build master files from this new template. Your custom SmartDataBrowser constitutes an extension of the ADM—a new ADM class.
Before you begin to develop a new ADM class, be sure you understand the basic ADM architecture as described in Chapter 1, “Overview,” and are familiar with the material in the other chapters of this manual.
Note: The current ADM file structure is different from that in earlier ADM versions, and takes advantage of core features that did not exist in those versions. If you implemented your own customizations to the standard ADM classes, please note the current ADM version does not support backward compatibility. Progress Software Corporation recommends you convert your applications to use the ADM custom files, as described in this chapter.
There are three ways to extend the ADM class hierarchy:
*Creating a new class at the bottom of the ADM hierarchy (also called subclassing) allows you to create new SmartObject templates without affecting existing SmartObjects: it affects only new SmartObjects that reference your new class.
Figure 8–1 shows the ADM class hierarchy for SmartFrames, to help illustrate bottom‑level extensions.
Figure 8–1: ADM hierarchical class structure for SmartFrames
The top (root) of the hierarchy is the smart class, which contains the essential behavior shared by all SmartObjects. (Recall the smart class is the root object for all SmartObjects.) As you work down the tree, you encounter successively more specific classes of behavior; in this case, the visual class and then the container class. The standard SmartObject templates are all based on bottom‑level (leaf‑level) ADM classes.
You use the New ADM Class tool to create the new ADM class files, then modify the standard class files by adding Progress 4GL code as required to provide behavior specific to your class. For details, see the “Creating a new class at the bottom of the ADM class hierarchy” section.
*Customizing an existing ADM class allows you to extend or modify its behavior by modifying the custom files that are built into it. You do not create any new class files when you customize an existing class: you simply change the behavior of a class by adding Progress 4GL code to one or more of its custom class files. For details, see the “Customizing an existing ADM class” section.
*Creating a new class at the middle of the ADM class hierarchy can be done by inserting a new class between two existing classes. This approach allows you to change or extend the standard behavior of existing SmartObjects.; however, you should be able to handle most extension needs by either creating a new class at the bottom of the hierarchy or customizing an existing class.
Note: Progress Software Corporation strongly recommends you do not create a new class in the middle of the ADM class hierarchy. It requires extensive knowledge of the ADM and entails significant risk of damaging your Progress installation.