> But what's this with TO's being an object only containing properties?
I
> thought that was a bean? So for instants I'd have a bean that
containing
> only getters and setters, nothing more, is that a TO, or is a TO more
like
> an active record that represents a row of table data?

Rob, 

It's just a really lightweight version of an object that can be passed
around.  It can also be used in the memento pattern (using a TO to
populate a bean). For example:


<cfcomponent displayname="userTO">
        <cfscript>
                THIS.id = 0;
                THIS.firstname = '';
                THIS.lastname = '';
                THIS.password = '';
                THIS.emailaddress = '';
        </cfscript>
</cfcomponent>

This TO would then be handed to another object, for example a DAO:

<cffunction name="Save">
        <cfargument name="to" type="path.to.TO" />
        <cfset var qSave = "" />        
        <cfquery name="qSave" datasource="#getDSN()#">
                UPDATE users
                SET     id = #arguments.TO.id# 
                        ,name = '#arguments.TO.name#'
                        <!--- etc... --->
                        <!--- and use CFQUERYPARAM! --->
        </cfquery>
</cffunction>


HTH

Rich Kroll

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273316
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to