Datasnap.DBClient.TConnectionBroker
Delphi
TConnectionBroker = class(TCustomRemoteServer)
C++
class PASCALIMPLEMENTATION TConnectionBroker : public TCustomRemoteServer
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | Datasnap.DBClient |
Description
TConnectionBroker centralizes the connection to an application server for a set of client datasets that all use the same connection.
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.