Using Client Datasets in a Multitier Environment

   

Client datasets are useful in a client-server environment as well as in multitier environments. In a multitier environment the client- user interface is separated from the business logic, which is in turn separated from the database server. The relationship between the business logic tier and the database tier is similar to that found in client/server applications. Thus, TClientDataSet can play a role.

In multitier, or distributed, environments, TClientDataSet does not connect directly with a local TQuery , but instead connects with a remote data module. A remote data module is a TDataModule that acts as an independent executable running ( potentially ) on a separate machine. Although the details of remote-data modules are best saved for a later chapter (Chapter 20, "Distributed Applications with DataSnap," and Chapter 21, "DataSnap Multitier Connections"), here is a brief look to identify the basic principles.

Figure 9.4 shows an image of a remote data module that surfaces a TQuery .

Figure 9.4. Remote data module.

graphics/09fig04.gif

Figure 9.5 shows the image of the local data module that is used by the client to contact the middle tier.

Figure 9.5. Local data module for a remote data module.

graphics/09fig05.gif

As you can see, the local data module contains a TClientDataSet for each TQuery in the remote data module; which, in turn, contains a separate provider for each TQuery it chooses to surface. The provider is contacted by the client data set on the client side, and packets are exchanged containing data from each TQuery in the remote data module, as needed.


   
Top


C++ Builder Developers Guide
C++Builder 5 Developers Guide
ISBN: 0672319721
EAN: 2147483647
Year: 2002
Pages: 253

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net