Thanks for that Sean, nice to see that I'm on the right track in most instances at least. This one I thought deserved a closer look though. What I was really thinking of here is a Mach-II application, where clearly all the listeners are in the application scope. If you want to implement a shopping cart, and you choose to do it using a fa�ade of some sort, what do you do? I'm picturing a fa�ade listener that then interacts with a cart CFC in a HAS-A relationship (i.e. the cart CFC is an instance variable within the cart fa�ade listener). If you wanted to pass a productID to your cart fa�ade, and then have it update the cart instance variable to reflect the addition of the new product, would you need to lock that update?
This could also be coming down to the fact that patterns like fa�ade are relatively new to me in the strict sense so I may not be approaching it correctly. Thanks, Brian > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Sean A Corfield > Sent: Wednesday, December 03, 2003 11:34 PM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Basic CFC Design Question > > 5) (In a CFC that has been instantiated into the application scope) > > <cffunction name="setInstanceVar"> > > <cfargument name="aValue" > > <cfset myInstanceVar = arguments.aValue /> > > </cffunction> > > DOES need to be locked (either inside the CFC or where the > > setInstanceVar() method is called) if other threads could > be reading > > from myInstanceVar. > > Probably not - an arbitrary thread reading the value will either get > the old value or the new value (which may or may not matter) but it > won't fail. Mind you, if you have multiple requests setting > values into > application scope (implicitly through the instance variable) then > you've probably got something weird going on anyway (i.e., > your program > logic is a bit strange). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
