So, you have to generate the CFC file and a separate DAO CFC file?  Hmm,
seems like a lot of extra work when you can simply introspect the properties
and create the insert, updates etc.  This assumes the property names and the
table field names match up.  Although you could theoretically have an alias
attribute to a property that maps the cf property to the database table.

I thought it was best practice for an object to know everything about
itself.  There's a school of thought that objects model real world things
and should know everything about itself.  If you follow this point of view,
then an object also knows how to display itself.  There's no reason why you
cannot have a save SQL method and a save xml method, etc.

Objects are powerful.

Thanks
 
Tom Schreck
972-361-9943

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Sean Corfield
Sent: Wednesday, April 27, 2005 3:17 PM
To: [email protected]
Subject: Re: [CFCDev] While we're on the subject of DAOs

On 4/27/05, Schreck, Tom <[EMAIL PROTECTED]> wrote:
> What's the concept behind DAO and CFCs?  Is it a separate file for
handling
> all of the inserts, updates, etc?

A DAO is a CFC that handles your persistence logic. It should be
separate from your business logic because business objects do not need
to know about how (or if) they get persisted. Hence separating your
SQL (or XML file handling) from your business logic.

This is generally accepted best practice and it is the reasoning
behind everything from Hibernate in Java to the act/qry file naming
convention in Fusebox.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

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



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

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


Reply via email to