On 27 January 2011 00:00, Clarkee21 <[email protected]> wrote:

> Thanks for the input guys and yeah I know what you're saying Mark. It's
> along the same lines as what I was saying about the decorator / original
> property thing :-). It's an unknown as to how it should be managed.
>
> Looking into things a bit more tonight it seems that Railo supports dynamic
> method name calls. ACF doesn't - well CF8 anyway, I don't know if CF9 has
> impressed on that side of things.
>
> So in Railo I can do object[method](args);  - if that's what you're
> referring to Quack (?)
>
> That would be fine to work, so I guess another argument would be that I'm
> trying to work around the restrictions CF8 is imposing on us rather than
> what the objects aren't giving me.
>
>
You can do pretty much the same thing in CF.

private any function callMethod (required string functionName, fnArgs) {
var thisFn = variables[arguments.functionName];
if (structKeyExists(arguments,'fnArgs')) return
thisFn(argumentCollection=arguments.fnArgs);
else return thisFn();
}


This is a method I wrote a while back to work with onMissingMethod.  (caveat
- I wrote it, but I may have "stolen" knowledge from other places)

Obviously this is a pure CF9 script function, but you can put it into an
ordinary CF8 function and it will work.
It needs to be applied to the object you're working with, so you'd add this
to your decorator (or a base decorator that you extend off of, so you aren't
repeating code all over the shop)

Then, using your example above, you'd call it like this

object.callMethod(propertyname)


Thats about it really.

Obviously its not built in, but not hard to implement and doesn't use
evaluate().....

Stephen

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to