Writing a Client Application
\The Sandbox \PB History & Future \New in PB 5 \Distributed PB \Client Application
Server
Application
Client Application

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:

  1. Create a connection object
  2. myconnect = create connection

  3. Specify the connection driver
  4. myconnect.driver="WinSock"

  5. Specify the server name
  6. myconnect.location = "SERVER01"

  7. Specify the server application
  8. myconnect.application="dpbserv"

  9. Connect to the server application
  10. myconnect.ConnectToServer()

  11. Create a local proxy for the remote object
  12. ruo = create remoteobject1

  13. Instantiate the remote object on the server
  14. ruo.SetConnect(myconnect)

  15. Invoke a method associated with the remote object
  16. 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. 

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com