How about displaying it on screen? There ARE use cases for
#Product.display('Title')# #Product.display('Price')#,
#Product.display("ThumbnailImage')#, etc. You could compose the cf display
template within the bean, but you'd still be left with
#THIS.display('Title')# all over the template.Do agree that in the general case you want to provide as few getters and setters as necessary. Best Wishes, Peter On 3/16/07 3:06 PM, "Aaron DC" <[EMAIL PROTECTED]> wrote: > Can I ask why you are getting discrete elements of a CFC? What do you > intend to do with the information once you have it? I don't mind my > tables having 100 or more fields, btw. > > Thanks > Aaron > > Phillip Senn wrote: >> Here's a typical getter: >> >> <cffunction name="getCustomerName" access="public" output="false" >> returntype="string"> >> <cfreturn variables.strCustomerName /> >> </cffunction> >> >> My impression is that if a table has 100 fields, then there are going to >> be 100 getters. >> >> Q: Is it possible to write a generic getter that uses perhaps an array >> index or some other voodoo method instead of hard coding 100 getters? >> >> <cffunction name="getter" access="public" output="false" >> returntype="any"> >> <cfargument name="Index" required="true"> >> <cfreturn variables.Array[arguments.Index] /> >> </cffunction> >> >> >> If the number 100 makes you uncomfortable, substitute the number 50, or >> 25. Whatever number you're comfortable with. I know some people balk >> at a table having 100 fields. >> >> > > > You are subscribed to cfcdev. To unsubscribe, please follow the instructions > at http://www.cfczone.org/listserv.cfm > > CFCDev is supported by: > Katapult Media, Inc. > We are cool code geeks looking for fun projects to rock! > www.katapultmedia.com > > An archive of the CFCDev list is available at > www.mail-archive.com/[email protected] > You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
