Hi Everyone,
Can anyone please guide me to implement singleton in a parent class.
Infact what I want is that All the childs etc. should use same instance of the parent.
I have implemented singleton, Changed the scope of parent class's constructor to "Protected". But in the application when ever the new child's constructor is called i.e. "Dim abc as New Ch1()" the constructor of Parent is called (as it is Proctected and can be access from child). Which is undesired behaviour.
Can anyone please give me some sample code etc for this or atleast some idea that how to implement singleton in parent class.
Thanks & Regards,
Maverick
Can anyone please guide me to implement singleton in a parent class.
Infact what I want is that All the childs etc. should use same instance of the parent.
I have implemented singleton, Changed the scope of parent class's constructor to "Protected". But in the application when ever the new child's constructor is called i.e. "Dim abc as New Ch1()" the constructor of Parent is called (as it is Proctected and can be access from child). Which is undesired behaviour.
Can anyone please give me some sample code etc for this or atleast some idea that how to implement singleton in parent class.
Thanks & Regards,
Maverick