Brian Kotek wrote:
>To me a TO is basically a simple struct, but possibly wrapped up as a
>CFC with public instance data. This would be just for moving data
>around with no other functionality.
>
>
Basically, this is the same for me - except I call the LTOs (lightweight
transfer objects) as a distinction from java TOs. I'll paste an example
below:
<cfcomponent displayname="phoneTo"
output="false"
hint="A LTO that model the phone form.">
<cffunction name="init" access="public" output="false"
returntype="phoneTo">
<cfargument name="phone_id" type="numeric" required="false"
default="0" />
<cfargument name="statuscode" type="string" required="false"
default="" />
<cfargument name="phone_call_type" type="string"
required="false" default="" />
<cfargument name="phone_number_type" type="string"
required="false" default="" />
<cfargument name="phone_area_code" type="string"
required="false" default="" />
<cfargument name="phone_number" type="string" required="false"
default="" />
<cfargument name="phone_ext" type="string" required="false"
default="" />
<cfscript>
this.Phone_id = arguments.phone_id;
this.Statuscode = arguments.statuscode;
this.Phone_call_type = arguments.phone_call_type;
this.Phone_number_type = arguments.phone_number_type;
this.Phone_area_code = arguments.phone_area_code;
this.Phone_number = arguments.phone_number;
this.Phone_ext = arguments.phone_ext;
return this;
</cfscript>
</cffunction>
</cfcomponent>
I feel that I gain a few things over a simple struct. When init()ing a
LTO, I can easily see what arguments I need
--
Peter J. Farrell :: Maestro Publishing
blog :: http://blog.maestropublishing.com
email :: [EMAIL PROTECTED]
________________________________
R O O I B O S G E N E R A T O R...
Create boilerplate beans and transfer objects for ColdFusion!
Rooibos is free to use at: http://rooibos.maestropublishing.com/
________________________________
Member of Team Mach-II - The next rev is coming...
----------------------------------------------------------
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]