[fpc-devel] TCustomConnection - why?

Michael Van Canneyt michael at freepascal.org
Sat May 7 16:04:40 CEST 2005



On Sat, 7 May 2005, Joost van der Sluis wrote:

> Hi all,
> 
> Can someone explain to me why TCustomConnection is implemented? And
> where was it based on?
> 
> In Delphi TCustomConnection is a child of TControl, not of TDatabase,

Of TComponent, actually.

> and is doesn't have EndTransaction and StartTransaction procedures.
> 
> I think that the idea behind TCustomConnection is the same of
> TDBDatabase. So I would suggest to implement all connect/disconnect
> stuff from TCustomConnection to TDBDatabase, and remove
> TCustomConnection.
> 
> Or am I missing something?

You are. 

First, TCustomConnection is there for Delphi compatibility, 
so removing it would be a bad idea, it was put there to 
allow tools as InstantObjects to compile. 

Secondly, TDatabase can also simply be a directory (e.g. with 
Dbase files), so it does not need 'connect' functionality, 
which is why TCustomConnection is a descendent and not an alias.
TDatabase is (loosely said) something that binds various datasets 
together. TCustomConnection is for actual client/server things.

In this sense, e.g. TSQLConnection should be a descendent of 
TCustomConnection instead of TDatabase. But I didn't have time 
yet to discuss that with you.
(too busy with the 2.0 docs, which are now finished BTW, so 
you can start firing questions...)

Michael.




More information about the fpc-devel mailing list