I just tested it out as well. I wrote a CFC with 2 methods. The private method was called from the public one. Using the three types of calls, the CFINVOKE using component="#this#" failed (as joe mentioned). The function call worked, as did the CFINVOKE with no component.
I'll do some deep speed tests to see which is better, but I expect it to come down to no real speed difference. Well, no difference other than style. :)
>Raymond / others with <cfinvoke component="#this#"...>
>
>It will fail, as it should, when trying to invoke a private method.
>
>It's a slowish afternoon, so I did this:
>
>Test.cfc:
><cfcomponent>
> <cfset myId = createUuid()>
> <cffunction name="sayHi" access="private">
> <cfoutput>sayHi: #myId#<br></cfoutput>
> </cffunction>
>
> <cffunction name="doSayHi">
> <cfoutput>doSayHi: #myId#<br></cfoutput>
> <cfinvoke component="#this#" method="sayHi">
> <cfinvoke component="test" method="sayHi">
> </cffunction>
></cfcomponent>
>
>Test.cfm:
><cfinvoke component="test" method="doSayHi">
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Re: CFC Practices Deanna Schneider
- RE: CFC Practices Spike
- Re: CFC Practices Michael Dinowitz
- Re: CFC Practices Barney Boisvert
- RE: CFC Practices Andrew Tyrone
- RE: CFC Practices Jim Davis
- Re: CFC Practices Joe Rinehart
- Re: CFC Practices Raymond Camden
- Re: CFC Practices Joe Rinehart
- Re: CFC Practices Joe Rinehart
- Re: CFC Practices Michael Dinowitz
- Re: CFC Practices Deanna Schneider
- RE: CFC Practices Andrew Tyrone
- RE: CFC Practices Guy Rish
- Re: CFC Practices Mark Drew
- RE: CFC Practices Dave Watts