Sorry if I made that point too strongly--it's not that it "shouldn't"
be used, but you have to be aware of what happens when you use
cfinvoke (which Tom outlines nicely).  If you're only making one call
to the object and don't need it for the rest of your request, then
cfinvoke is a quick way to call a method and get something back.  (As
an aside, with the way I build things I hardly ever use cfinvoke, but
your mileage may vary.)

If you use CreateObject() you can chain method calls, so on one line
you could do this:
myCFC = CreateObject("component", "MyCFC").someMethod(arg1, arg2)

In the example above you'd just have to worry about the return
type--if "someMethod" returns something OTHER than an instance of the
CFC itself, you couldn't do that, but if the return type is the CFC or
void, then it would work.

You can also just instantiate the CFC first and then run methods on
the instance:
myCFC = CreateObject("component", "MyCFC");
myCFC.someMethod(arg1, arg2);

Hope that helps to clarify.

Matt

On Wed, 9 Feb 2005 08:30:48 -0600, Chris Gomez <[EMAIL PROTECTED]> wrote:
> At last nights meeting, it was brought up that CFC's should not be
> called using the CFINVOKE command. If that's the case, then how would
> you call a CFC and, more importantly, how do you call a CFC that
> requires arguments be passed to it?
> 
> Thanks,
> 
> Chris
> ----------------------------------------------------------
> To post, send email to [email protected]
> To unsubscribe:
>    http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> To subscribe:
>    http://www.dfwcfug.org/form_MemberRegistration.cfm
> 
> 


-- 
Matt Woodward
[EMAIL PROTECTED]
http://www.mattwoodward.com
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe: 
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe: 
   http://www.dfwcfug.org/form_MemberRegistration.cfm


Reply via email to