cfinvoke object=#application.imgobject# method=#scaleMethod# ...
cheers,
barneyb
On 9/14/06, Andy Matthews [EMAIL PROTECTED] wrote:
I'm using Rick Root's image.cfc which contains scaleX and scaleY methods.
Right now I'm doing an if statement with two lines for the call to the CFC.
cfif
Use cfinvoke
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 12:17 PM
To: CF-Talk
Subject: Dynamically calling methods in a CFC
I'm using Rick Root's image.cfc which contains scaleX and scaleY
methods.
Right now I'm doing an if
not what you're going for exactly...but could you just have a method
called 'scale()' and pass it an argument (X or Y)...the scale() method
could then call the scaleX() or scaleY() method as required.
it's not the single line you were looking for...but at least the logic
would be in the CFC
:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 11:20 AM
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
cfinvoke object=#application.imgobject# method=#scaleMethod# ...
cheers,
barneyb
On 9/14/06, Andy Matthews [EMAIL PROTECTED] wrote:
I'm using Rick Root's image.cfc which
You may also use evaluate() - store the function name(s) in variables then
evaluate them.
TK
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 12:17 PM
To: CF-Talk
Subject: Dynamically calling methods in a CFC
I'm using Rick Root's
: Thursday, September 14, 2006 11:24 AM
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
not what you're going for exactly...but could you just have a method
called 'scale()' and pass it an argument (X or Y)...the scale() method
could then call the scaleX() or scaleY() method as required
I've already got the object instantiated to the App scope though.
cfinvoke object=#application.imgobject# method=#scaleMethod# ...
This version of the cfinvoke tag uses your object in the application scope, not
the component=#application.imgobject#. I believe is should be component not
evaluate() is satan. CFINVOKE will do the job. It can call methods
statically, or on a preexisting object (per my previous email).
cheers,
barneyb
On 9/14/06, Tom Kitta [EMAIL PROTECTED] wrote:
You may also use evaluate() - store the function name(s) in variables then
evaluate them.
TK
--//-
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 11:20 AM
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
cfinvoke object=#application.imgobject# method=#scaleMethod# ...
cheers,
barneyb
On 9/14/06, Andy
Subject: Re: Dynamically calling methods in a CFC
evaluate() is satan. CFINVOKE will do the job. It can call methods
statically, or on a preexisting object (per my previous email).
cheers,
barneyb
On 9/14/06, Tom Kitta [EMAIL PROTECTED] wrote:
You may also use evaluate() - store the function name
.
Visit our website at http://www.reedexpo.com
-Original Message-
From: Barney Boisvert
To: CF-Talk
Sent: Thu Sep 14 17:33:44 2006
Subject: Re: Dynamically calling methods in a CFC
evaluate() is satan. CFINVOKE will do the job. It can call methods
statically, or on a preexisting object (per my
Quite possible. I don't think I've never used that syntax. ;)
Yesterday was the first time I can recall ever using the CFINVOKE at
all, and I was inside the CFC I was calling, so I didn't need it.
cheers,
barneyb
On 9/14/06, Ian Skinner [EMAIL PROTECTED] wrote:
I've already got the object
: Dynamically calling methods in a CFC
evaluate() is satan. CFINVOKE will do the job. It can call methods
statically, or on a preexisting object (per my previous email).
cheers,
barneyb
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 100 invites
No, but it'd be trivial to implement a custom tag that does this for
you. The default method would be application-specific, so an
in-language mechanism for this wouldn't make much sense.
cheers,
barneyb
On 9/14/06, Robertson-Ravo, Neil (RX)
[EMAIL PROTECTED] wrote:
Adding to this Q, is there a
a contract :(
cfinvoke is 50% faster then using evaluate.
TK
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 12:53 PM
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
While it may not be as bad as it once was in terms performance
Andy,
Try using this:
cfset a = APPLICATION.imgObj[scaleMethod]/
Then:
cfset a(yourArgs) /
If you notice the methods live in the this and variables scopes in the CFC
along with any other variables. Becuase of that, you can treat the method as a
key in the scope struct and create a reference
Turns out the cfinvoke doesn't support 'object' parameter as in your
example.
Yeah, Ian corrected me above on that. You use 'component' for both a
componet name and a component instance (which seems odd). FB4/5 XML
grammar's INVOKE verb has an 'object' attribute for specifying an
existing
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
Andy,
Try using this:
cfset a = APPLICATION.imgObj[scaleMethod]/
Then:
cfset a(yourArgs) /
If you notice the methods live in the this and variables scopes in the CFC
along with any other variables. Becuase of that, you can treat
I don't think it's odd per se. One way lets you use an object you may
not have an instance of:
component=foo
and one lets you use an instance, which you may want to do for
performance or data reasons
component=#foo#
On 9/14/06, Barney Boisvert [EMAIL PROTECTED] wrote:
Turns out the cfinvoke
Perhaps 'odd' is the wrong term. It's ambigious. I.e. does
component mean component name/path, or does it mean component
instance? Leaving that ambiguity is an odd design choice to me. It
seems much less confusing to have two distinct attributes, be they
name/object, path/instance, or
To: CF-Talk
Subject: Re: Dynamically calling methods in a CFC
While it may not be as bad as it once was in terms performance-wise, it's
still bad for various other reasons. If you feel you need to use
evaluate(), chances are good you're missing a language facet or you have a
design flaw somewhere
21 matches
Mail list logo