Assuming that you access the singleton using a static getInstance() method it will not be removed.  If you hang the singleton reference off the application I suppose there is some chance of it being removed, but frankly if you have anyone on your team who reassigns the application reference I think I'd get rid of them.  I have not thought of a valid use-case where the root application would be replaced wholesale.

 

Matt

 

-----Original Message-----
From: sbyrne_dorado [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 3:31 PM
To: [email protected]
Subject: [flexcoders] Re: Lifetime of _global vs Application.application

 

Just so I'm clear, you're saying that under no circumstances will the
singleton class be removed?  Programmatic replacement of the top level
application won't discard this singleton?  And the replaced
application when it refers to the singleton class will be referring to
the exact same class (and thus singleton)?

--- In [email protected], Matt Chotin <[EMAIL PROTECTED]> wrote:
> I think rather than storing things directly on the application or on
_global
> I'd recommend using a singleton class.  That way you can control
things a
> little better programmatically but still have the static reference which
> will exist for the life of the app.
>





Reply via email to