O/H anomander1 έγραψε:
>
>
> Hello,
>
> I have a question regarding the use of TDataModule.
> When i first started using Delphi, i always set Datafiles on
> TDataModule. Now though, i code my datasets with
>
> ado := TADODataSet.Create.....
>
> Can anyone point me in the direction of what i should use?
> using ado := ... seems faster for me to use.
> Is there any reason why i should not do this?
>
> TIA
>
> Marco
TDataModule is JUST a TComponent with a .dfm resource
visible at design-time. It could be usefull to a
programmer who prefers the design-time "coding"
that is using the Object Inspector.
There is nothing magical to it.
Droping components on a TDataModule gives you
the impression of easyness and speed in
programming. Everything droped on it
is automatically destroyed. But you
can not control the order of distruction.
Unless you code it.
You can have the same functionality by just
coding it by hand. The way you do
ado := TADODataset.Create....
In fact, I prefer this second way
because it gives a better oversight
to the programmer.
You may code your own "version" of a
TDataModule-like class, to be more general
and more usefull and more suitable to
many cases. Say a TComponent descendant
(TBaseModule?) with a windows handle, capable of receiving
messages, which provides a set of virtual
methods like Select(ID: Integer), Delete(ID: Integer)
etc etc, and which represents a set of relative
database tables, with one of them as the top
table. Of cource you can have the same result
by having TDataModule as your base class.
--
Regards
Theo
------------------------
Theo Bebekis
Thessaloniki, Greece
------------------------
Greek_Delphi_Prog : a Delphi Programming mailing list in Greek at
http://groups.yahoo.com/group/Greek_Delphi_Prog
CSharpDotNetGreek : A C# and .Net mailing list in Greek language at
http://groups.yahoo.com/group/CSharpDotNetGreek
atla_custom : a Unisoft Atlantis Customization mailing list at
http://groups.yahoo.com/group/atla_custom
------------------------
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/delphi-en/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/