Tagged Questions
5
votes
4answers
514 views
Is there something like a polymorphic Singleton?
I have a resource loader object that loads objects from the disk or from a ZIP archive, depending on the platform.
It has state (e.g. the path to the directory or the ZIP archive, and possibly some ...
0
votes
5answers
345 views
should singleton be life-time available or should it be destroyable?
Should the singleton be designed so that it can be created and destroyed at any time in program or should it be created so that it is available in life-time of program. Which one is best practice? ...
0
votes
0answers
64 views
Singletons in C++, are they really necessary, used? [duplicate]
Possible Duplicate:
When is Singleton appropriate?
Ok, most people probably know what a singleton is, use them, and know all the drawbacks including race conditions and so on.
But what I ...
11
votes
7answers
3k views
What are the roles of singletons, abstract classes and interfaces?
I am studying OOP in C++ and, even though I am aware of the definitions of these 3 concepts, I cannot really realize when or how to use it.
Let's use this class for the example:
class Person{
...
5
votes
4answers
448 views
C++ - Best way to have a central data repository
I'm coding in C++. I have a server that will have clients connect to it, and each client gets spun off into its own thread for communication. This server is hosting a game, so there is information ...