> But why make the rest of us programmers figure out your proprietary > objArgs technique? in this particular case, my boss would be very happy if i made the app incomprehensible to anyone outside the company, but i see your point.
> Doesn't the CFC itself look nicer when it doesn't have that this line? > <cfargument name="objargs" required="no" default="#arguments#"> true > Don't you have to replace arguments.foo with arguments.objargs.foo? yep you do (is that a big hardship?) (if so, could do: var args = arguments.objargs !!!!!) > How do you make individual arguments required? CFC is generic, it has no idea what its going to be passed (decides what to look for depending on what you init it with), so if i used the argumentCollection technique, there would be no <cfargument> tags in the functions. (which means im not so sure about your 2nd point in this case) > One of the nice things about argumentCollection is that it works with > existing CFCs. true > And myobj.foo(argumentCollection=form) may look ugly, but it does > serve a purpose. true > And I can also call the CFC using the order of the arguments rather > than the name [ obj.doSomething(1,2) ]. I can't do that with your > method because the CFC will assume the first argument is objArgs. Cant do that because the function has no cfargument tags (besides objargs) Kerry -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Patrick McElhaney Sent: 27 January 2005 14:05 To: cfcdev@cfczone.org Subject: Re: [CFCDev] Composition and SQL On Thu, 27 Jan 2005 13:34:14 -0000, Kerry <[EMAIL PROTECTED]> wrote: > 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) !!!!!!!) > But why make the rest of us programmers figure out your proprietary objArgs technique? Doesn't the CFC itself look nicer when it doesn't have that this line? <cfargument name="objargs" required="no" default="#arguments#"> Don't you have to replace arguments.foo with arguments.objargs.foo? How do you make individual arguments required? One of the nice things about argumentCollection is that it works with existing CFCs. And myobj.foo(argumentCollection=form) may look ugly, but it does serve a purpose. I know that these are equivalent. <!--- The normal way ---> <cfset obj.doSomething(a=1,b=2)> <!--- The argumentCollection way ---> <cfset args = structNew()> <cfset args.a = 1> <cfset args.b = 2> <cfset obj.doSomething(argumentCollection=args)> And I can also call the CFC using the order of the arguments rather than the name [ obj.doSomething(1,2) ]. I can't do that with your method because the CFC will assume the first argument is objArgs. 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/cfcdev@cfczone.org ---------------------------------------------------------- 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/cfcdev@cfczone.org