RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TConnectionBroker Class

TConnectionBroker centralizes the connection to an application server for a set of client datasets that all use the same connection.

Pascal
TConnectionBroker = class(TCustomRemoteServer);
C++
class TConnectionBroker : public TCustomRemoteServer;

DBClient

Use a connection broker when your application has several client datasets that all use the same connection component to establish a connection to an application server. If you set the ConnectionBroker property of all your client datasets to a single connection broker, then you can change the connection component that handles the connection to an application server for all of them by changing the connection broker's Connection property. That is, instead of changing the RemoteServer property of every client dataset, you can change a single property on the connection broker. 

Similarly, the connection broker centralizes the use of the application server's interface and events that occur when you open or close a connection to the application server. Thus, if you need to change the connection component (for example, to use a different protocol), you do need to rewrite your event handlers for the BeforeConnect, AfterConnect, OnGetUserName, OnLogin, BeforeDisconnect, or AfterDisconnect events or any calls that use the connection broker's AppServer property. The AppServer property and the event handlers can reside on the protocol-neutral connection broker rather than on the connection component, and so will not disappear when you switch to a different connection component. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!