No, you don't need to var scope your arguments. Unless you have some
reason for wanting to have a copy of the arguments you don't need to
worry about duplicating or var-scoping them.

As far as how CFC's behave for each user, as long as you are
var-scoping your local variables you will be fine. And yes you're
right, if you instantiate a CFC into the application scope, there is
only one instance of the CFC and all users of the application are
using that single instance. This is an implementation of the Singleton
design pattern (if you have any interest in patterns).

I wrote an article for Techrepublic a while back that talks about
CFCs, locking, and persistent scopes. It might help make some of this
gel further. You can read it here:
http://techrepublic.com.com/5100-3513_11-5543910.html

Hope that helps,

Brian




On 9/3/05, Andy McShane <[EMAIL PROTECTED]> wrote:
> OK, thanks for all this info so far guy's. Now then, am I correct in saying
> that I should be scoping all of my argument var's to local var's within each
> of my functions within my cfc's? Now, is it acceptable, in instances where I
> pass in an argument collection, to copy the argument collection to a new
> local collection i.e. duplicate the argument structure to a new local
> structure? Can someone give me a brief idiot's guide on how CFC's and
> individual functions behave for each user? i.e. when initializing in the
> application scope the CFC is available application wide to each user, does
> this mean that only 1 instance of the CFC ever exists or is there 1 for each
> user session? Is each call to the CFC session independent or is this where I
> need to be understanding the whole locking/race condition issue, each call
> is awaiting for another call to finish first. Bear in mind that so far all
> my CFC's do is handle database interaction. Am I even making any sense at
> all, I do not know, I am so confused ;-(
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217283
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to