Introduction to Client Dataset Concepts

   

Typical client/server database applications obtain records from a provider across the network (we usually call this a database server). When the client is data intensive , displaying large numbers of records as you scroll back and forth in a grid or other data-aware control, this can cause large amounts of network traffic. Such network traffic can involve transferring redundant records and can unnecessarily use up network bandwidth. It can also slow application response time below tolerable levels.

The answer to the problem is to provide some sort of buffering that is local to the client. The implementation of that in the VCL is TClientDataSet and its descendants.

Client datasets are write-through caches. A write-through cache acts as a buffer for records retrieved and also intercepts and duplicates changes being sent back to the provider. The application sees the changes immediately when it next reads from the client dataset, without the need to request changed records from the provider, thus, eliminating unnecessary network traffic.

Figure 9.1 shows a diagram describing the relationship between the various elements of the chain from database server to user interface.

Figure 9.1. Client data set and provider in client/server and multitier configurations.

graphics/09fig01.gif

This diagram depicts the relationship between the database server, the datasets, the provider, the client datasets, the data source, and, finally, the data-aware control. It also shows the location of those components in two different models: the client/server model and the multitier model.

In the client/server model, all components reside within a local data module, except for the database server, which exists on its own, separate platform.

In the multitier model, some components reside on a separate platform within a remote data module; others exist within the local data module.

In the case of the client/server model, there is a single transport of information across the network. In the case of the multitier model, information is passed across the network twice: once from the database server to the remote data module and once from the remote data module to local data module. More information on the multitier model can be found later in this chapter.

Generally, client datasets are located in the memory of the client. This optimizes their performance in a way not possible with disk-located client/server buffers.

One other feature of client datasets can be useful. Client datasets enable your application to work in a briefcase mode. Briefcase mode, similar to the briefcase mode on the Windows desktop, enables you to be detached from the network on which the client/server database is located and still work with records from that database. At the time that you reconnect with the home network of the client/server database server, the client/server dataset will attempt to propagate changes back to the server. If errors occur during that resolution process, for instance, if fields have values that were changed by applications during the time the briefcase was separated, exceptions will be thrown or events will be triggered that can enable you to provide alternatives to the user of your application.


   
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