Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

several instances of singleton class

I have some class it is a singleton we have this class in already several applications and it is used there as a singleton.

Now i am writing some new application and i need several instances of that class , what is a best practice to have sevaral instances of it ?

By deriving from it and making the private constructur to be public, I work with c# ?

Or there can be someother idea here ?

Thanks

like image 809
Night Walker Avatar asked Aug 10 '10 19:08

Night Walker


Video Answer


1 Answers

Simple: don't make it a singleton. The word 'single' is there for a reason.

like image 96
BoltClock Avatar answered Oct 13 '22 20:10

BoltClock