I am experiencing an unexpected issue with ColdFusion Markup Language. Let's say I have the following components. If both a public and a private function are defined in a "base" component, can the former still invoke the private one when called from an extending "sub" type's instances?
Program.cfc
<cfcomponent>
<cffunction access="public" name="doOperation">
<cfset this.checkValue(-14)>
</cffunction>
<cffunction access="private" name="checkValue">
<cfargument name="notNeg" required="yes" type="numeric">
<cfif arguments.notNeg LT 0 >
<cfthrow message="Negative Numbers not allowed">
</cfif>
</cffunction>
</cfcomponent>
SubProgram.cfc
<cfcomponent extends="Program">
</cfcomponent>
Run.cfm
<cfobject component="SubProgram" name="this.instance">
<cfset this.instance.doOperation()> <<<<----ERROR---->>>>
ColdFusion throws the error
method
checkValue
was not found in componentSubProgram
. Ensure that the method is defined...
What is the issue here? No brownie points for encapsulation!