In a Coldfusion component / CFC, I want to properly scope some variables to be available for all contained functions, but to be hidden or blocked from outside scripts. What is the name of the cfc's memory scope? Is it 'variables'? Is that available inside a contained function? Is it blocked from outside the cfc?
(Examples in CF 8)
Calling page:
<cfset settings = structNew()>
<cfset util = createObject("component", "myUtils").init(settings)>
<cfoutput>
#util.myFunction()#
</cfoutput>
myUtils.cfc:
<cfcomponent>
<!--- Need to set some cfc global vars here --->
<cffunction name="init" access="public">
<cfargument name="settings" type="struct" required="no">
<!--- I need to merge arguments.settings to the cfc global vars here --->
<cfreturn this>
</cffunction>
<cffunction name="myFunction" access="public">
<cfset var result = "">
<!--- I need to access the cfc global vars here for init settings --->
<cfreturn result>
</cffunction>
</cfcomponent>
Additional best practice suggestions are welcomed. It's been quite a while since I've done this. Thanks in advance.