Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-05

TCustomConnection - why?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

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, 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?

Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 6 lines
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.

Show quoted text 8 lines
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.

Reply by email

Joost van der Sluis
to Michael Van Canneyt
Show quoted text 12 lines
> 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.

Create an alias to TDBDatabase or rename TDBDatabase to TCustomConnection.

Show quoted text 11 lines
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...)

There's a difference between TDatabase and TDBDatabase. Now it is:

TDatabase - TDBDatabase - TSQLConnection.

So I think that the idea behind TDBDatabase is the same as TCustomConnection.

(The TDBDatabase also has transactions and datasets assigned to it, so that if the TDBdatabase closes, all transactions and datasets are closed and such)

Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 38 lines
> > 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. Create an alias to TDBDatabase or rename TDBDatabase to TCustomConnection. > 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...) There's a difference between TDatabase and TDBDatabase. Now it is: TDatabase - TDBDatabase - TSQLConnection. So I think that the idea behind TDBDatabase is the same as TCustomConnection. (The TDBDatabase also has transactions and datasets assigned to it, so that if the TDBdatabase closes, all transactions and datasets are closed and such)

MMMMyes. In that case we should make TCustomConnection an alias for TDBDatabase.

Michael.

Reply by email

Uberto Barbini
to Michael Van Canneyt
MMMMyes. In that case we should make TCustomConnection an alias for TDBDatabase.

If the interfaces are identical I see no problems. Anyway could you rename TDBDatabase? It's orrible and I overlooked it when I searched for a TConnection replacement... ;)

Bye Uberto

Reply by email