Keeping an application properly encapsulated (2 or 3 tier) is important.
However...
1. It can easily be achieved using the following tiers: 
        Presentation Layer - a form, containing the DB-aware components
(TDBGrid, Edits, etc) as well as the rest of the
GUI.
        Business Layer - a datamodule, containing your TTables, Queries,
etc. as well as methods and classes that perform                the
business functions.
        Data Layer - your database.

2. Using a single query, for all your application may reduce your memory
usage, but you reduce performance if you have to create & destroy the
object the moment you're done retrieving your data. If you use a
specific query many times, one whose returned data is fairly
non-volatile (i.e. doesn't change too often), then you increase the
network load each time you must requery it, and if you also need to
recreate the object, well, you're reducing performance, as previously
mentioned.

3. Of course, if you use run-time created objects, you run the risk of
not disposing of them properly (me?!? I never forget to free an object.
Yeah, right). And then you're taking a stroll down memory-leak lane.

4. Using tables (at least in ado), with master/slave relationships,
allows you to fairly easily perform most simple queries locally, without
having to access the external database. Internal workings are always
faster.

5. Finally, using 2 or 3 tier methodology, or *any* methodology is
important, but it should never be so strictly adhered to, that it
becomes an inconvenience or worse.

Anyway, these are my 0.02$, based on my experience. YMMV (but I don't
think by much).
Assaf.

-----Original Message-----
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 27, 2005 8:07 PM
To: [email protected]
Subject: Re: [delphi-en] Re: Re: commercial grid component



   Well, I like having them available at design-time
so I can use code completion. Plus, I don't understand
why a db component would be "behind the scenes" since
I usually display the data to the user in some way.

DJS

--- David Bolton <[EMAIL PROTECTED]> wrote:

> Reliability and robustness. Its all OO either way
> but if you write a lot of
> code at the form level its more of a hack than if
> you write bespoke classes. 
> Its less important if you have one query, but if
> you're working with 
> multiple tables, are you going to reuse the same
> query component (ie making 
> if 'global')  or have a load of form query
> components, or as I prefer, have 
> the query component created dynamically at runtime
> and used 'behind' the 
> scenes? I prefer the query to be part of the class.
> 
> David Bolton
> 
> 
> ----- Original Message -----
> From: "David Smith" <[EMAIL PROTECTED]>
> > What's the big advantage to working with TQueries non-visually?
> >
> > DJS
> >
> > --- David Bolton <[EMAIL PROTECTED]> wrote:
> >
> >> I don't  use components that let a user work
> >> directly on the database. Oh
> >> sure they are ok for a quick and dirty hack, but
> a
> >> well structured
> >> application is done best by splitting into three
> >> tiers. Presentation Layer
> >> (the GII- front end), business logic (middle
> tier)
> >> and backend (database
> >> tier). For smaller apps this can be reduced to
> two
> >> tiers. Front End and
> >> database but again there is no direct ability for
> a
> >> user to amend values. I
> >> don't use ttable (or whatever the ado/mysql
> >> equivalent) is but mainly
> >> queries. And they are created dynamically as
> members
> >> of a class and do not
> >> exist as components on a form.
> >>
> >> David Bolton
> >>
> >>
> >> ----- Original Message -----
> >>
> >> >   No, DBAdvStringGrd. It was slow in reading
> and
> >> > displaying table data.. sorting too. It was the
> >> most
> >> > common complaint on their user forum and I saw
> >> that
> >> > many a programmer rejected it for that reason.
> >> Maybe
> >> > doing it yourself in AdvStsringGrid is faster.
> >> >
> >> > DJS
> >> >
> >> >
> >> > --- David Bolton <[EMAIL PROTECTED]> wrote:
> >> >
> >> >> The advstringgrid? Slow? No- I find it very
> fast,
> >> >> especially with sorting.
> >> >> Slow for doing what? Do you use BeginUpdate
> and
> >> >> EndUpdate when adding or
> >> >> removing rows? (same with Borland's string
> grid).
> >> >>
> >> >> David Bolton
> >>
> >
> 



        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links



 


 This mail arrived via mail.pineapp.net
 
************************************************************************
************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals &
computer viruses.
************************************************************************
************


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
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/

<*> 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/
 


Reply via email to