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

> ## Example

> An OpenEdge developer at company ABCPets designs and develops an inventory system for pet shops, using the AppBuilder (`.w` files). These source files are in the directory `c:\ABCPets\Source\Inventory`. The files are compiled, and the r-code files are placed in `c:\ABCPets\Bin\Inventor`y. ABCPets wants to package this functionality for Java clients. You run ProxyGen and supply the following information:

> - AppObject Name — `Inventory`

> - Propath Components — `c:\ABCPets\Bin`

> - Enable Unknowns for Parameter and Return Values — checked

> - Procedures — `Inventory\InvAdd.r`

> - Persistent Procedures — `Inventory\p-Cust.r`, with internal procedures:

> - `AddInventory()`, which takes two `INTEGER` parameters
> - `ValidateInventory()`
> - `UpdateInternals()`, which is defined in `Inventory\p-Cust.r` as `PRIVATE`

> You customize the method definition for `AddInventory()` to disable the use of objects for passing the 4GL Unknown value (`?`) in either parameter. You also explicitly exclude `ValidateInventory()`. Note that the internal procedure `UpdateInternals()` is defined with the `PRIVATE` keyword and does not appear in ProxyGen as a procedure to include or customize.

> When you choose the Generate button, you supply the following information:

> - AppService — `com.ABCPets.Inventory`

> - Package — `com.ABCPets`

> - Output Dir — `c:\Proxies`

> Proxy generation places the Java proxy (the `.class` files) into `c:\Proxies\com\ABCPets`, and creates the activity log as `c:\Proxies\Inventory.log`. The generated Java files include:

> - `Inventory.java`

> - `Inventory.class`

> - `InventoryImpl.class`

> - `pCust.java` (note the removal of the dash)

> - `pCust.class`

> - `pCustImpl.class`

> You then change `p-Cust.w` but do not change the signature of `AddInventory()` (`AddInventory(INTEGER, INTEGER)`). You add new internal procedures to the persistent procedure `p-Cust.w`. These changes only require you to run ProxyGen to regenerate the proxy as long as you want them included. New non-`PRIVATE` internal procedures are added as methods automatically, with default definitions. To exclude them, you must run ProxyGen and customize the persistent procedure definition. Also, any changes in or the removal of `ValidateInventory()` do not cause validation errors because it is excluded from the proxy definition and is not validated.

> You decide to run Batch ProxyGen as part of a regular build cycle, so any similar changes in the 4GL are picked up automatically.

> Later in the development cycle, you add a new procedure file for inventory, called `Orders.w`. This procedure file is saved in `c:\ABCPets\Source\Inventory,` and the r-code file is placed in `c:\ABCPets\Bin\Inventory`. You then run ProxyGen before the scheduled build and add this procedure file to the `Inventory` AppObject.

> You make another change to the `AddInventory()` procedure, which now takes a third parameter (`CHARACTER`). Because this is a new parameter, it automatically gets the default (AppObject) setting to enable access to 4GL Unknown value (`?`). If you want to disable access to the 4GL Unknown value (`?`) by eliminating support for using objects as parameters and instead using equivalent intrinsic types (where available in the language), you must run ProxyGen before the scheduled build and update the customizations for this procedure.

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