Consider the following CFC:

<cfcomponent>
         <cffunction name="test">
                 <cfset a()>
                 <cfset variables.a()>
                 <cfset d()>
                 <cfset variables.d()>
                 <cfset this.d()>
         </cffunction>
         <cffunction name="a" access="private">
                 <cfoutput>a</cfoutput>
         </cffunction>
         <cffunction name="d" access="public">
                 <cfoutput>d</cfoutput>
         </cffunction>
</cfcomponent>

If you call the test method, you will see that it executes fine, which 
indicates that public methods are accessible from both the "this" scope 
and the "variables" scope. Now consider the following CFC:

<cfcomponent>
         <cffunction name="test">
                 <cfset a()>
                 <cfset variables.a()>
                 <cfset this.b = a>
                 <!--- <cfset b()> doesn't work --->
                 <cfset this.b()>
                 <cfset d()>
                 <cfset variables.d()>
                 <cfset this.d()>
         </cffunction>
         <cffunction name="a" access="private">
                 <cfoutput>a</cfoutput>
         </cffunction>
         <cffunction name="d" access="public">
                 <cfoutput>d</cfoutput>
         </cffunction>
</cfcomponent>

In the above example, method "a" is assigned to the this.b. However, 
b() is not accessible from the unnamed scope, but it is executable from 
the "this" scope even though it is declared private.

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com
(888) 408-0900 x901


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to