|
The client application has three main components:
- User interface
- Proxy objects
- Connection object
The client application contains all of the windows and menus required to interact with the business user. In addition, the client application has a proxy object for each remote object provided by the server application.
To allow a client application to function in a distributed environment, you need to connect to a server application. Connecting to a server application is very similar to connecting to a database. To establish the connection, you use the connection object, which is a nonvisual object that works like the transaction object.
To connect to a server application:
- Create a connection object
myconnect = create connection
- Specify the connection driver
myconnect.driver="WinSock"
- Specify the server name
myconnect.location = "SERVER01"
- Specify the server application
myconnect.application="dpbserv"
- Connect to the server application
myconnect.ConnectToServer()
- Create a local proxy for the remote object
ruo = create remoteobject1
- Instantiate the remote object on the server
ruo.SetConnect(myconnect)
- Invoke a method associated with the remote object
result=ruo.method1(parm)
Unlike the transaction object, the connection object is not a built-in global object. You need to declare a variable of type connection. Typically, you will want this variable to be global.
|