>From: Dennis Chuah [mailto:[EMAIL PROTECTED]]
>
>Data controls are good for the quick phone book type apps, but when you
want
>to do something more sophisticated, their limitations get in the way.  Case
>in point is the TDBGrid - it causes all sorts of locks to be placed,
because
>it keeps an open cursor.  If you must use it, better to select your data to
>a temporary table, and display the table - there are all sorts of other
>gotchas using data aware controls.

Using ClientDataSets enables you to avoid these limitations.

>For someone new to c/s programming using data controls may seem like a good
>idea, but unless you know all the pitfalls, use then judiciously.  If
>something doesn't work - take the data controls out, and test again.

There are indeed pitfalls for the unwary, but to implement your own system
is to build your own pitfalls.  If you have the time to do it, well and
good, but there are a lot of well written data aware controls out there.
IMO it's still worthwhile spending time evaluating other people's components
(although writing your own is more entertaining :).  An analogy - Windows
(any version) may not be the best operating system but any suggestions to
ditch it and develop your own should be taken with a rather large grain of
salt.

>Using data controls encourage the practise of mixing your business rules
>with your UI.  This makes the code difficult to reuse, port and maintain.
>That is my main gripe about them.  Far better to create a data model and
>have your controls operate on the data model (not on datasets).  You can
>then cleanly partition your code out into layers, eg. db access, storage,
>rules, UI.

I have sympathy for what you're advocating in a theoretical sense, and it's
certainly what I used to do before Delphi came along.  However the Borland
team have certainly spent much more effort supporting the d/a line than they
have the non-d/a line - and it's not a _bad_ solution.  I've found plenty of
caveats and had to bug fix and workaround, but overall I feel it's served me
very well.  Some people will always achieve better results by developing
their own system, but most of us will do best by going mainstream.

Cheers,
Carl

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to