[fpc-devel]TDataset Buffer rewrite

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Aug 3 14:05:30 CEST 2004


On Tue, 3 Aug 2004, Joost van der Sluis wrote:

> Ok,
>
> i've had it with the TDataset Buffers.

:-) Join the club.

>
> They work now but not as they should, resync is buggy and it's not very
> Delphi-compatible.

Well. It was modeled to be compatible with D3 code.

>
> The main issue here is that there's no difference between TDataset and
> TClientDataset. In the FCL they are somewhat combined.

Not really, why ?

>
> So i suggest that I try to re-style TDataset and add
> TClientDataset. TDataset with a buffer of 10 records as it is now, and a
> TClientDataset which buffers all records.

Stop. The 10 buffers are the default. Controls such as TDBGrid can
increase the number of buffers so that the minimum number of buffers
needed to draw the control are always in memory.

I.e. if the grid has 25 rows, then 25 buffers must be present at all times.
That is why the buffer count must be variable.

>
> Also i want to implement the resync and refresh methods as they are in the
> interbase components of Delphi.

And how is this ?

>
> tDbf would be a descendent of TDataset and TIbQuery of
> TClientDataset.

Fine, this is what I suggested you do.

But: Don't call it TClientDataset, call it TBufDataset as I suggested.
TClientDataset is MUCH more than just additional buffers:

It handles Delta's (buffered updates), local storage to file,
additional indexing, aggregate fields, internal calc fields etc.

>
> But i want to suggest than no-one else touches TDataset until i'm done. To
> avoid double work.

I have no problem with that. I want to apply one more patch tonight
(for resync), and as of tomorrow, you may assume you have complete
control over TDataset.

If you want, mail me in private to discuss some more. I have some
additional ideas which I wanted to implement to make writing TDataset
descendents more easy, while keeping the current TDataset.
As it is now, it is quite cumbersome.

Michael.




More information about the fpc-devel mailing list