My understanding of singletons is that it doesn't matter what
particular instance of the singleton a given client interfaces with,
rather, that there can only ever be a single instance available at any
given time.  To put that another way, it shouldn't matter if you
reinitialize your singleton every request, aside from the obvious
performance implications.  As long as there is never more than one
instance, you should be fine.

It's a subtle point, but if it's true, then you needn't worry about
the side effects.  At some point, one request will use the current
singleton, and on the next request, a new instance of the singleton
will take it's place.  You'll have to start you caches at empty again,
and let them fill and balance (assuming you're caching), but that's
about it.

cheers,
barneyb

On Sun, 31 Oct 2004 17:44:33 -0500, Barry L Beattie <[EMAIL PROTECTED]> wrote:
> thanx Sean
> 
> >> There is: pass the data in when you create the service layer (and it
> passes it into the persistence layer when it creates that).
> 
> the controller/presenter is a singleton that is decorated by all the services it 
> needs (and the persist decorates its' service). This makes it one big singleton 
> which is then stored in either Application or Server scope (depending on install).
> 
> to do as you suggest would mean the controller would explicitly destroy all services 
> and re-initialise them with the new values.
> 
> I'll have to think about what side-affects it might cause...
> 
> thanx
> barry.b
> 
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/blog/

I currently have 0 GMail invites for the taking
----------------------------------------------------------
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]

Reply via email to