Generating the proxy objects
About proxy objects
Each remote object contained in a server application has a
corresponding class definition in the client application. The class
definition on the client can contain the complete implementation
of the remote object, or simply a proxy object that provides a representation
of the remote object’s interface. In either case, you can
access remote objects on a distributed server. However, only the proxy
object is required on the client for distributed processing.
Local driver not supported with 6.0 and 7.0 proxy objects You cannot use the Local driver to test a distributed application
if you have 6.0 or 7.0 proxy objects in the library list for the
application.
Advantages of using proxy objects
By deploying proxy objects in your client applications, you
can reduce the size of your clients and also add a layer of security
by preventing the clients from accessing sensitive business algorithms.
However, if you want to have the option to instantiate the objects
locally, you need to have the complete implementation for the objects
available in the client application.
What you need to do
To generate one or more proxy objects for a client application,
you need to create a new project in the Project painter. The new
project lists the objects that will be included and specifies the
name of the output library that will contain the generated proxy
objects.
To generate one or more proxy objects:
-
Select File>New from the menu
bar. -
On the Project tab, select the Proxy Library icon.
The Project painter workspace displays.
-
Select Edit>Select Objects from the menu
bar.The Select Objects dialog box displays.
-
In the Libraries box, select one or more PBL files
that contain user objects for which you want to create proxy objects. -
In the Objects box, select the user objects for
which you want to generate proxies and click OK.If you select an object that participates in an object hierarchy, PowerBuilder
will automatically generate proxies for the selected object’s ancestors. -
Select Edit>Properties from the menu
bar.The Properties for Proxy Library dialog box displays.
-
Enter a filename for the target PBL in the Output
Library box. -
Select Clear Output Library for Each Build if
you do not want PowerBuilder to append the generated proxy objects
to an existing library (if one with the same name already exists).
If you select this checkbox, PowerBuilder will overwrite the existing
PBL with a new one that contains the generated proxy objects. -
If you do not want PowerBuilder to prompt you
before overwriting the output file when a library with the same
name already exists, deselect Prompt For Overwrite. - Click OK.
-
When you have finished defining the project object,
save the object by selecting File>Save from the menu bar. - Click the Build button in the Project PainterBar.