Var scoping and module calls in cfc

If I have a method in CFC that needs to call some inherited code through a module call (to perform some critical functions), do I risk variable “bleeding”? For instance:

<!--- in my cfc --->
<cffunction name="myFunc"> 

   <cfset var qData = "">
   <cfmodule template="some_legacy_code.cfm" attr1="hi" attr2="hello">
   <cfreturn qData>

</cffunction>


<!--- in some_legacy_code.cfm --->
<cfquery name="qData">
     select * from x
</cfquery>

<cfset caller.qData = qData>

Using caller.qData in this example, do I contaminate the variable region of the calling CFC, even if I have var coped qData?

What is the best way to check for this bleeding so that I can “see it for myself”, given that I cannot easily play multiple simultaneous calls from different requests, how can a real application come across?

Thank you for understanding.

+2
source share
1 answer

, -, , ( ). cfc, , cfmodule "" cfc. , cfmodule caller.

, "var scoping" cfmodule. , cfmodule.

var , ( ). , , . !

+2

All Articles