I find that I occasionally end up wanting to dynamically decide which method
of a CFC to call.  It ends up looking something like:

cfcInstance.tempMethodName = cfcInstance[cfcMethodNameIWant];
cfcInstance.tempMethodName(whateverArgs);
structDelete(cfcInstance,"tempMethodName");
...
Any opinions on this practice? Is it a "bad thing"?

I was going to suggest using this:

    cfcInstance[cfcMethodNameIWant](whateverArgs);

...but in testing I found something interesting. This dumps a function:

    <cfdump var="#cfcInstance[cfcMethodNameIWant]#"/>

...but when you try to call that function, this throws a parse error on the parens:

    <cfoutput>#cfcInstance[cfcMethodNameIWant]()#</cfoutput>

Not what I would have expected. Why do you suppose? Is this a bug?

--

    Ben Curtis
    WebSciences International
    http://www.websciences.org/
    v: 310 478 6648
    f: 310 235 2067






----------------------------------------------------------
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