how to store singletons in a parcel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to store singletons in a parcel

Rob Vens
I have a number of objects that share a flyweight object that is implemented as a singleton.
When I parcel out these objects, and parcel them in, I have two instances of the singleton. How can I make sure the singleton, already present in the image on loading, is used? Do I work with "named objects"? And if so, how do I use them?
Reply | Threaded
Open this post in threaded view
|

Re: how to store singletons in a parcel

Reinout Heeck
Rob Vens wrote:
> I have a number of objects that share a flyweight object that is
> implemented as a singleton.
> When I parcel out these objects, and parcel them in, I have two instances
> of the singleton. How can I make sure the singleton, already present in the
> image on loading, is used? Do I work with "named objects"? And if so, how
> do I use them?

If you are not using named objects then you are not parceling out a singleton
instance.

To me it sounds more like the singleton's holder may have been initialized
multiple times, try a breakpoint in the initializer code.


HTH,

Reinout
-------