I'd suggest creating a class that has a package scoped variable that you can feed and retrieve single objects. Feed it way of instantiating your object if it isn't created.
Singleton objects are always a very touchy, delicate things. Containment, testing and what not are difficult.
|Replies are listed 'Best First'.|
Re^3: Making an Existing Class a Singleton
by salva (Abbot) on Jan 24, 2008 at 16:24 UTC