Marlon,

We put all our service files in the APP scope, so we can run

qUser = APPLICATION.user_info_service.query( user_ID=URL.user_ID );

and get a full recordset back for that user, or

APPLICATION.user_info_service.query( selectAll=0,
selectCols="user_first_name, user_last_name", user_ID=URL.user_ID );

to get just their first and last name.

For INSERT and UPDATE this is all we code:

APPLICATION.user_info_service.add( data=FORM );
APPLICATION.user_info_service.update( data=FORM, user_ID=FORM.user_ID );

And a new record is created or updated based on the form fields
submitted that match DB column names, anything else is ignored.  On the
last three revs of the app I'm working on I have probably only written
5 actual CFQUERY tags, and the rest of the time I'm just calling my
service components.  It goes quickly that way.

During development I do wish it could automatically adjust to a changed
table def but unfortunately it can't.  I'd need to rerun the service
file generator or manually edit the file.  Once on the live server, it
wouldn't matter because I personally wouldn't want to look up my table
structure, it's already been defined and isn't changing.  That's a point
we may differ on. On my wish list is to build a little spider to go over
my code and run reports of used methods and arguments and then I can go
back and remove the unused methods and arguments from my components to
help streamline them for deployment.

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 Marlon Moyer
Sent: Thursday, April 29, 2004 10:49 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] the DAO of CFMX

Tyler,

I still have work to do on my code, and one of the other features I
thought about is to dynamically create the table structure on
instantiation.  This would make the DAO something that you'd want to
persist in a shared scope.
The benefit would be that if the table changed, the change would
automatically be realized in the DAO.  You would only have to change
your business logic layer.

Marlon



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