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/[email protected]

Reply via email to