Yeah, that seems fine. In fact, I'm wondering why I don't do that. :)

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057
________________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Joe Ferraro
Sent: Wednesday, May 25, 2005 5:28 PM
To: [email protected]
Subject: RE: [CFCDev] object composition - which method is better in
coldfusion?

This is how I see it

<cffunction name="load" access="public" output="false" returntype="void">
� <cfset var orderDAO = createObject('component','blah.orders.orderDAO')>
� <cfset var order = orderDAO.read(variables.instance.orderNumber)>
� <cfset this.init(argumentCollection=order.getInstance())>
</cffunction>
����� 
<cffunction name="save" access="public" output="false" returntype="void">
� <cfset var orderDAO = createObject('component','blah.orders.orderDAO')>
� <cfif orderNumber eq "">
� ��<cfset order.insertOrder(this)>
� <cfelse>
� ��<cfset order.update(this)>
� </cfif>
</cffunction>

I actually will only be using the load method because the objects are handed
off to the inventory management system for persistence but here it is for
illustration. Does this look good?



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

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

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


Reply via email to