Your inventory CFC does not contain any instance data, and thus would be a
good candidate for placing in the application scope.

To help you understand the difference, consider the following CFC:

<cfcomponent>
        <cfset variables.myname = "" />

        <cffunction name="init">
                <cfreturn this />
        </cffunction>
        
        <cffunction name="setName">
                <cfargument name="myName" />
                <cfset variables.myname = arguments.myname />
        </cffunction>
        <cffunction name="getName">
                <cfreturn variables.myname />
        </cffunction>
</cfcomponent>

If this CFC was placed into the application scope, you would run into race
conditions.  This sequence could happen if this CFC was placed in a shared
scope: User A calls setName("Rich"), User B calls setName("Vince"), User A
calls getName() and is returned "Vince".

Since your CFC does not contain any instance data, it can safely be placed
in a shared scope.

HTH,
Rich



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289017
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to