Progress
ADM 2 Guide
Running SmartDataObjects in a Distributed Environment
The SmartDataObject supports distributed computing. You can run a SmartDataObject in a distributed environment using either the traditional client/server model or the AppServer model:
- In the client-server model, the SmartDataObject runs entirely on one machine as a single
.r
file and is connected to the necessary databases.- In the AppServer model, the SmartDataObject is split across the network using AppServer technology, as follows:
- A SmartDataObject proxy, also called a client proxy, resides on the client machine. It interfaces with other client-based procedures and with the complete SmartDataObject on the AppServer machine.
- A complete SmartDataObject resides with the database on the AppServer machine. It interacts with the database and with the SmartDataObject proxy on the client machine.
The complete SmartDataObject and its proxy interface with each other using AppServer technology.
Note that in this model, it is possible to use a complete SmartDataObject rather than a client proxy on the client machine. This configuration occurs when the partition is configured to run remotely and the client is connected to the database at run time. It happens because the decision on whether to use complete SmartDataObject or a client proxy is based on whether the proper databases are connected, a decision that is independent from the decision on whether to run remotely or locally. Since the partition is an instance property of the SmartDataObject, it is possible to determine which partition is to be used and whether or not it is to be executed locally or remotely only after starting up the SmartDataObject or its proxy. The SmartDataObject runs the same way regardless of whether you run the complete version or its proxy, but the complete version includes code that is not executed by the client in a remote configuration.
Regardless of how you will deploy your SmartDataObject, you need to build it only once and maintain a single set of source code. This is because when you build a SmartDataObject, you use conditional preprocessor statements that identify code sections requiring database access and enable compiling the SmartDataObject into two versions:
- A database-aware version that contains all of the SmartDataObject code. This version can be used either in the traditional client/server model, or in the AppServer model as the AppServer-resident procedure that accesses the required databases.
- A nondatabase-aware version that is compiled with all database-access sections compiled out of the r–code. This version is suitable only as the client proxy on the client machine in the AppServer model.
NOTE: You need to compile conditionally into database-aware and nondatabase-aware versions only if your SmartDataObject will run in a distributed environment using the AppServer model. This is because it is the only configuration in which the SmartDataObject is split into database-aware and nondatabase-aware versions.The following sections describe how to set up the master (
.w
file) for your SmartDataObject so that it will compile conditionally into database-aware and non-database-aware versions, how the AppBuilder modifies the master, and what happens when the SmartDataObject is initialized in an application.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |