Release 10.1A: OpenEdge Development:
Open Client Introduction and Programming

> ## Objects in an Open Client interface

> Any single Open Client interface maps an AppServer application to a series of object types, as shown in Table 3–1.

> Table 3–1: Objects in an Open Client interface
> Object Type | Occurrences | Description
> --- | --- | ---
> AppObject | One required per application. | Encapsulates zero or more external Progress procedures as directly callable methods and zero or more ProcObjects as class factory methods.
> SubAppObject | Zero or more per application. | Encapsulates zero or more external Progress procedures as directly callable methods and zero or more ProcObjects as class factory methods.
> ProcObject | Zero or more per application. | A persistent procedure that encapsulates one or more Progress internal procedures and user-defined functions as directly callable methods.

> ##### The AppObject and SubAppObjects

> The AppObject and any SubAppObjects defined for the application each encapsulate the same type of functionality, consisting of external procedures and ProcObjects. In Progress, an external procedure is any single file containing separately executable 4GL code. A ProcObject directly maps to a persistent procedure, which is a special type of Progress external procedure. So, all the functionality encapsulated by the AppObject and SubAppObjects consists entirely of one or more external procedures.

> The minimum requirement is one AppObject that encapsulates all external procedures for the application. SubAppObjects allow you to compartmentalize these external procedures into collections you find useful to your particular application.

> ##### ProcObjects

> A ProcObject maps to a Progress external procedure that is executed in a special manner that leaves an active named context available in session memory when its own execution completes. This named session context (or persistent procedure) contains one or more internal procedures or user-defined functions declared within the persistent procedure, along with any commonly accessible data declarations.

> These internal procedures and functions are then available for access by callers external to the persistent procedure that defines them. On the AppServer, these callers can include other external Progress procedures that execute in the same Progress session, or they can include clients of an AppServer (including Open Clients and Web service clients) that call these internal procedures and functions as methods. A persistent procedure is, in itself, a kind of Progress object that encapsulates functionality for use by other external procedures. ProxyGen maps each such persistent procedure that you include in an Open Client interface to a corresponding ProcObject, with the internal procedures and functions becoming its methods.

> ##### ProcObjects or procedures?

> ProxyGen allows you to distinguish between non-persistent procedures and persistent procedures (ProcObjects) for all external procedures that you include in your Open Client interface. As indicated previously, a persistent procedure is an external procedure that leaves behind an active named context when it completes execution. Other than this, and the need to manage persistent procedure context, there is no difference between non-persistent and persistent procedures within Progress.

> Progress makes an external procedure persistent or non-persistent by the way you invoke the procedure, not by the procedure’s definition or content. You can thus arbitrarily include any Progress external procedure in an Open Client interface as non-persistent or persistent. For Web services and Open Client proxies, however, access to the functionality of a non-persistent procedure is very different compared to a ProcObject, and it requires different object management, depending on the session model (see the "Session models" section) and object types involved.

> ##### Encapsulating functionality

> For an Open Client proxy or Web service definition, all three types of objects—AppObject, SubAppObject, and ProcObject—encapsulate functionality as object methods. All these methods are callable by Open Clients and Web service clients. Only the ProcObject, however, always requires a persistent session context in which to make its methods available.

> When you choose external procedures to include in an AppObject or SubAppObject, you must clearly understand the intent of each procedure, those intended as methods and those intended as ProcObjects. Any procedure designed to run persistently typically is mapped as a ProcObject. ProcObject definitions never stand alone but always must be included as part of an AppObject or SubAppObject definition in the Open Client interface.

> Also, for every Open Client object you define, ProxyGen defines a set of common methods for managing that object. Most of these built-in methods do not execute procedures in the AppServer application; however, the client application must use these methods to create and manage the objects according to their Open Client object relationships. Depending on the session model and the object type, this management can have an impact on client and AppServer performance.

> For more information on how these built-in methods work with each object type, see Chapter 4, "Programming Concepts," and OpenEdge Development: Java Open Clients , OpenEdge Development: .NET Open Clients , or OpenEdge Development: Web Services .

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