G
Guest
I woundered if the following would be possible:
I want to create an abstract Singleton class, which implements the singleton
behaviour with the limitation, that the unique object will not be created
within the getInstance() method.
The classes which are derived from the Singleton class, have to implement a
static constructor, where they load an instance into the static unique
variable.
Now I have to problems with that:
1. Is it possible to create an instance of a class inside its own static
constructor?
2. The static unique variable is inside the base class, so it would be the
same for all the derived classes and the whole idea is just stupid. Or has
every derived class its own static unique?
thanks a lot...
Stampede
I want to create an abstract Singleton class, which implements the singleton
behaviour with the limitation, that the unique object will not be created
within the getInstance() method.
The classes which are derived from the Singleton class, have to implement a
static constructor, where they load an instance into the static unique
variable.
Now I have to problems with that:
1. Is it possible to create an instance of a class inside its own static
constructor?
2. The static unique variable is inside the base class, so it would be the
same for all the derived classes and the whole idea is just stupid. Or has
every derived class its own static unique?
thanks a lot...
Stampede