Progress
Open Client
Developer’s Guide
Object Model
ProxyGen requires that you organize Progress AppServer functionality into three possible types of proxy objects:
All of these proxy objects organize 4GL procedures on the AppServer, but in different ways. The following sections describe the different ways of organizing proxy objects and contains information about:
4GL Procedures
Before describing the three types of proxy objects, it helps to understand a few basic concepts that govern the operation of 4GL procedures. First, any single file that is executable by Progress is an external procedure. An external procedure can contain one or more internal procedures or user-defined functions that execute within and share the context of the external procedure. You can execute an external procedure in two basic ways:
When you execute a non-persistent procedure, the procedure executes and returns to the caller, removing all trace of its context from memory after it returns. Any internal procedures and functions that it defines can only be executed by the procedure itself. As a result, a non-persistent procedure executes and returns as a unit without exposing any of its context to the caller.
However, when you execute a persistent procedure, the procedure leaves its context active after it completes execution. Internal procedures and functions then remain available for future execution. Thus, a persistent procedure essentially instantiates a procedure object that exposes its context to the caller through the internal procedures and functions that it defines. For more information on 4GL procedures, see the Progress Programming Handbook .
The Progress AppBuilder, which is part of the Progress Application Development Environment (ADE), also allows you to build preprogrammed persistent procedures that adhere to the Progress Application Development Model (ADM). The Progress ADM allows you to build persistent procedures as reusable application building blocks known as SmartObjects. The Open Client Toolkit allows you to access a type of SmartObject known as a SmartDataObject, which dynamically accesses and updates data. As a result, you can run a SmartDataObject on the Progress AppServer like any persistent procedure, and, using the Open Client Runtime, access the SmartDataObject from a Java or ActiveX application, or Java applet. In Java you can also access the SmartDataObject as an extended Java Database Connectivity (JDBC) 2 ResultSet. For more information, see Using SmartDataObjects From Java Clients." For more information on SmartDataObjects, see the Progress AppBuilder Developer’s Guide .
AppObjects and SubAppObjects
AppObjects and SubAppObjects are similar in that both expose the functionality of a group of 4GL external procedures as methods to the Open Client. However AppObjects create and maintain a connection to the AppServer, while a SubAppObject uses the connection already created by an associated AppObject.
Although you can encapsulate an AppServer’s entire functionality within one AppObject, dividing a large AppServer application into one AppObject and several SubAppObjects offers several advantages. Multiple objects provide better logical organization and separate name spaces for each of the objects. Additionally, they help avoid the instantiation of large objects that are slow to load and difficult to maintain.
ProcObjects
A ProcObject encapsulates the functionality of a single persistent procedure on the AppServer. It exposes non-PRIVATE internal procedures and functions as methods to the Open Client. A ProcObject always uses its associated AppObject’s connection to remotely execute the persistent procedure.
Object Relationships
In an Open Client application, you create the AppObject first in order to access AppServer functionality. You can then create a SubAppObject through its associated AppObject, and you can create a ProcObject through its associated AppObject or SubAppObject. You use a special method, a Class Factory method, to create a SubAppObject or ProcObject. Thus, the total package comprised of one AppObject and all SubAppObjects and ProcObjects that share the same AppServer connection is a single proxy.
Although there is a creation hierarchy among the different types of proxy objects, there is no functional hierarchy among them. All objects share the AppServer connection with equal status. The objects can be released (have their context removed from client memory) in any order with no effect on the objects that remain in use. The connection to the AppServer remains intact until the last object that uses it is released.
In summary, each type of proxy object encapsulates and accesses AppServer functionality as shown in Table 1–1.
Once you define an AppObject, its methods and any related SubAppObjects and ProcObjects, ProxyGen can generate the proxy that exposes these objects to Open Clients.
The client code accesses the proxy in the client’s native environment. As a result, a Java client sees the proxy (and the AppServer functionality) as a Java class definition, while a Visual Basic client sees the proxy as an ActiveX Automation object. To use proxy objects, you must deploy the generated proxy along with the Open Client Runtime to all client application development and deployment systems. For more information about development and deployment, see Configuration and Deployment."
The Open Client Toolkit installation includes an SDOAppObject. This is a prebuilt proxy that allows you to access any remote Progress SmartDataObject from a Java application without needing to run ProxyGen. Therefore, an SDOAppObject is essentially an AppObject that provides the built-in interface to a remote SmartDataObject, but not to any other remote 4GL procedure.
If you want to access other remote 4GL procedures in addition to SmartDataObjects, you can include the additional 4GL procedures you want to access when you build the AppObject or SubAppObject using ProxyGen. You can then use the same built-in interfaces to SmartDataObjects provided for SDOAppObject proxies to access SmartDataObjects using the AppObject or SubAppObject that you have built.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |