Generic Abstract Singleton with Custom Constructor in C#
- by Heka
I want to write a generic singleton with an external constructor. In other words the constructor can be modified. I have 2 designs in my mind but I don't know whether they are practical or not.
First one is to enforce derived class' constructor to be non-public but I do not know if there is a way of it?
Second one is to use a delegate and call it inside the constructor?
It isn't necessarily to be a constructor. The reason I chose custom constructor is doing some custom initializations.
Any suggestions would be appreciated :)