I agree with Barney 100%.  I'm much more comfortable in not having any
loops for each and every INSERT or UPDATE call.  Publishing a file with
the table structure defining the CRUD statements is much easier to
account for this like required and non-required fields.  You can hard
code in a dtLast_update = Now() in your UPDATE statement if the table
has a field for that.  There are still cfif statements around
non-required fields, so some conditional logic occurs, but I'd much
rather have some if statements than loops running.

We've been using a DAO system since CF 5 or 4.5 w/ cfmodule and when we
upgraded to components with CFMX it was suggested that we have a single
SQL broker and store table definitions in a struct like the code example
previously posted.  There wasn't a very good sense it would scale at all
with all loops to define the insert/update statements.  We can make very
specific modifications for each table if needed and not have to worry
about it breaking the usage of the base component with the other 20
tables in our system.  We publish a separate component for each
table/view in the system that we want and know that it can be
independently modified for enhancements without bringing down all the
others.

I've got the tool available here - http://smartermx.com/code - it's
called Build Services.  I think it's pretty slick - but that's me being
a proud parent.  If you want to play with it, note the restiction on
being able to run it on CFMX 6.1.

That's that.

t

********************************************************************** 
Tyler M. Fitch 
Certified Advanced ColdFusion MX Developer 
Portland ColdFusion User Group Manager http://www.pdxcfug.org

http://isitedesign.com 
**********************************************************************  
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Barney Boisvert
Sent: Thursday, April 29, 2004 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] the DAO of CFMX

Building a generator that will take a table schema and create a custom
DAO is only marginally more work than a generic DAO, and it'll be much
more efficient at runtime, so I suspect that's the way people are going.
I know of at least a handful of tools that'll do generation like that,
and I'm sure there are numerous more that are private.

Cheers,
barneyb


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to