On Mon, 29 Nov 2004 10:29:26 -0800, Barney Boisvert <[EMAIL PROTECTED]> wrote:
> CFINVOKE and createObject are very different beasts.  CFOBJECT and
> createObject are the same, but CFINVOKE creates and instance of the
> CFC, calls the specified method on it, and then lets the instance
> disappear, with no hope of holding on to it for future reuse.
> 
> Here's two examples of creating an object instance:
> <cfset i = createObject("component", "test") />
> <cfobject action="create" type="component" name="i" class="test" />
> 
> And here's two examples of calling a method on a CFC, without creating
> an instance:
> <cfset r = createObject("component", "test").testMethod() />
> <cfinvoke component="test" method="testMethod" returnvariable="r" />
> 
> cheers,
> barneyb
> 

Yeah, sorry -- should have been more clear. As others have pointed
out, you can simply create an instance into a local variable and then
use that variable in the cfinvoke tag. Why would you do that? I guess
just preference (I use cfscript/cfobject everywhere, so this isn't
personal experience -- just pointing out that you could do it this
way).

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185580
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to