First of all -- it's now public information, AFAIK, that RedSky fixes the page context bug (and it should be out "soon").
Second, you might consider instead storing your instance of the objectStore in the application scope and then using instance variables inside the store to keep all your data. That way, you can pass the single instance of the objectStore around by reference and preserve encapsulation while avoiding all page context but issues altogether. This is the way it "should" be done (or some variation -- avoid referencing shared scopes inside CFCs whenever possible). Finally, if you need a solution now and don't like the suggestion above, use the server scope instead of the application scope -- it is not subject to the page context bug. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Tim Blair > Sent: Tuesday, July 29, 2003 9:42 AM > To: [EMAIL PROTECTED] > Subject: [CFCDev] Object "store" > > > Evening. > > I have an object "store" (objects/store.cfc) which is a CFC that checks > the application scope for a stored instance of a given object and either > returns a reference to that or creates a new instance, stores that and > returns the reference to the new object. > > This is fine for using in the "application code" but I also want other > CFCs to be able to utilise the effects of the store, so I have a base > class (objects/base.cfc) that all other objects extend and has an init > function that takes in the argument of a reference to a store object -- > this reference is passed by the store object itself by passing "this" as > an argument and stores is as an instance variable. > > So now, from within any object, I can call > instance.objectstore.get("mycfc") to return a reference to the > appropriate object. My concern is that the object store uses references > to the application scope, so although I've been trying to avoid breaking > object encapsulation by passing the object through, I'm doing it by > using the object. I'm thinking that I'm going to get stuck with the > page context bug? > > Any thoughts? > > Tim. > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
