I probably shouldn't mention it since it's bad practice. :) However, in most apps that I get to design from scratch, the column name is the property name is the form field name all the way through the system.
So, what I did was create a base component which all my business objects or transfer objects (if I am using them) extend. The base component has a method on it called setProperties(). It takes a structure or scope (like the form scope) and loops over it. It looks for public methods called setKeyName where KeyName is the name of the key in the structure. If it finds one, it calls it, passing in the value of the key. It's kind of hacky, but it works fine in many situations. Components can also override the setProperties() method if necessary. Ben Rogers http://www.c4.net v.508.240.0051 f.508.240.0057 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Kerry > Sent: Thursday, January 27, 2005 8:34 AM > To: [email protected] > Subject: RE: [CFCDev] Composition and SQL > > yeah i know about argumentcollection, but i like being able to call the > function like this: > > myobj.foo(form); > > just laziness on my part i guess.... (but it just looks nicer than > myobj.foo(argumentcollection=form) !!!!!!!) > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Patrick McElhaney > Sent: 27 January 2005 13:19 > To: [email protected] > Subject: Re: [CFCDev] Composition and SQL > > > On Thu, 27 Jan 2005 09:32:03 -0000, Kerry <[EMAIL PROTECTED]> wrote: > > > > I do this in generic cfcs: > > <cfargument name="objargs" required="no" default="#arguments#"> > > > > This way, you can pass in all the (named) arguments seperately, and > objargs > > will populate itself, or you can pass in an object/form/struct, and it > will > > still work. > > > > What do you think, elegant solution or nasty hack? > > > Pretty neat trick. But there's a built in solution that works even better. > :) > > See "argumentCollection" in the docs. > > http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi19.htm > > Patrick > > -- > Patrick McElhaney > 704.560.9117 > http://pmcelhaney.blogspot.com > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.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' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.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' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
