Home arrow Delphi-Kylix arrow Demystifying the Client Dataset

Demystifying the Client Dataset

The TClient Dataset component available in Delphi encapsulates a lot more features than one would expect from a dataset component. TClient DataSet is a specialized component that holds data in-memory and can be used effectively in different application architectures. It does not require a database connection to work and for that reason it is suited to file-based application architecture.

Author Info:
By: Danish Ahmed
Rating: 5 stars5 stars5 stars5 stars5 stars / 11
December 12, 2007
  1. · Demystifying the Client Dataset
  2. · Introducing the Client Dataset
  3. · Using Filters and Ranges with the Client Dataset
  4. · Cache Updates

print this article

Demystifying the Client Dataset
(Page 1 of 4 )

The client dataset can be used in single-tiered or two-tiered application and multi-tiered applications as effectively to cache updates and resolve them in one transaction. The client dataset offers robustness, speed and flexibility, and has features to make the best use of whichever architecture it is a part. Since it is self-contained and does not require persistent server connection applications created, using it is not dependent on data access mechanisms like BDE or ADO. For the same reason applications using the client dataset are easier to port to other platforms without requiring a complete rework.

The list of features and methodologies offered by the TClientDataset component is exhaustive so there is always a probability that you might not have discovered all of its functions. In this series of articles I will attempt to demonstrate how the client dataset can be included and taken advantage of in all three architectures I mentioned above -- file based, single-tiered or two-tiered and n-tiered architectures.

Most datasets you are likely to work with commit transactions with the data source the moment you make a change. As you insert records, delete or edit them, the information is sent to the database server which modifies/inserts/deletes records to reflect the changes you made. If you are connecting to a remote database server, continuous transactions can increase your network traffic to such an extent that it may actually degrade the performance.

To avoid this you can use the Client Dataset to fetch records, store and edit them locally and commit them to the database in a single transaction. This approach helps reduce network traffic and enhances the performance of your application. Before proceeding further let us take a closer look at the TClientDataSet component.  

The Client Dataset component was introduced in Delphi 3 as a specialized dataset to work with MIDAS (now called DataSnap) applications. However, its features are not limited to MIDAS applications; it can be substituted for most datasets when  greater flexibility and control over the database transaction is needed. The last two versions of Delphi I have worked on, Delphi 7 (cs edition) and Delphi 2006 (BDS 2006), contain the Client Dataset component in the tools pallet, but I have read that some versions don't. Assuming that your version of Delphi includes the client dataset component, let us find out more about this component.

blog comments powered by Disqus

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials