Out of the 8 patterns that I know of my favourite design pattern is the Singleton. Reason: Simplictiy. I love simplicity. Besides that, this pattern has been very useful to me. The pattern does the best of the things using the most elegant language features in C++. Neat work without too much hassle. Also the fact that improper usage is detected at compile time means that error detection happens at a better level than having to reproduce and debug a crash bug or something similar. In some ways this is application error prevention. I must say that it took me some reading to figure out that the copy constructor can be a stealthy enemy. How many such pattens can one find, where 7 lines of code give such an elaborate and elegant solution. If you do not know about singleton design pattern, read on... What is a singleton class? In abstract terms a singleton class is a class that will/can have atmost one instance. I will give some examples also. I am a gamedeveloper and so I will tell you from my experiences. When I start the game, I would assume that there is only one sound card in the computer. So I would go about creating a manager that would handle all the resources. However I would like to have just one instance of this manager. Why? Every sound card has a set limit on the number of sounds it can play. It can vary from 8 to 64. Some of the crazy cards can have the number higher than 64. The bottom line here is that there are a fixed number of sounds that a card can play at any given time. We can call them sound channels. So I need some way of ensuring that there is only one person (aka class) who handles these sound channels. class SoundResource { // Some hardware related stuff blah. }; class SoundMgr { SoundMgr(const uint num_channels); // Instantiate the manager with number of channels for this sound card ~SoundMgr(); void PlaySound(const std::string& filename); // Dont worry about it void StopSound(const std::string& filename); // Dont worry about it private: SoundResource* sound_channels; // vectors?? }; const uint DEFAULT_NUM_CHANNELS = 8; // Just in case SoundMgr::SoundMgr(const uint num_channels) { // some error checking here ... ... sound_channels = new [num_channels] SoundResource; // reserve } SoundMgr::~SoundMgr() { delete [] sound_channels; } Now I, as a gamedeveloper for around 4 yrs, know that there can be only one instance of this class. So I take care while writing the code to create exactly one instance of the class. main() { // some work blah ... uint num_channels = DetectNumChannels(); SoundMgr* global_soundmgr = new SoundMgr(num_channels); // blah blah ... } However this newbie who joined two days ago did not know that much about sound cards. So he wanted a handle to the sound manager and he did this: void TryPlay() { SoundMgr* my_soundmgr = new SoundMgr(); my_soundmgr->PlaySound("myfile.wav"); } Not his mistake. He does not know about all these. However, I as an experienced developer should have ensured that would not have happened in the first place. What happened exactly? Well he created another sound manager and it has allocated default number of channel resources to the my_soundmgr. What does this result in? If you are lucky an outright crash when instantiating my_soundmgr and if you are not, some random stack overrun, who knows. I believe that it is always best to ensure that possible mistakes like those come out as compile time errors. Runtime errors might be difficult to detect. Prevention is better than cure in some sense. So how do I solve this problem? I would like to generate a compile time error. Something that will make him sit up and think about what he has done with the SoundMgr and what I intended it to be used as. I will basically ensure that he can only get a handle to the sound manager and that he cannot create another SoundMgr. I will create it, let him just use the manager. Now here is the trick. Restrict creation of the objects. If I do not allow him to access the constructor, he cannot create a new sound manager. In which case, how do I create the instance in the first place? Here it is: class SoundMgr { private: SoundMgr(const uint num_channels); // Instantiate the manager with number of channels for this sound card ~SoundMgr(); public: void PlaySound(const std::string& filename); // Dont worry about it void StopSound(const std::string& filename); // Dont worry about it static SoundMgr* GetSoundMgr(const uint num_channels); static void Destroy(); private: static std::vector sound_channels; // You can use an array. Then allocate the resources dynamically. Using this for simplicity. static SoundMgr* global_soundmgr; }; SoundMgr* SoundMgr::global_soundmgr = NULL; // or 0 your wish. I prefer NULL. It has a meaning. SoundMgr* SoundMgr::GetSoundMgr(const uint num_channels) { if ( global_soundmgr == NULL ) { global_soundmgr = new SoundMgr(num_channels); } return global_soundmgr; } void SoundMgr::Destroy() { if ( global_soundmgr ) { delete global_soundmgr; global_soundmgr = NULL; // Careful about this. Merely deleting a pointer may not always assign the pointer to 0/NULL. Depends on compiler } } In the above code I am accessing a private member variable using a static but public method. Since the method is static I need to make the member variable also static. If I do not make the member method static, then I would not be able to access the method in the first place. So GetSoundMgr will create an instance if it doesnt exist. My fellow developers cannot call new because the constructor is private. That would generate a compile error. So there is no way they can have a second instance of sound mgr. Or is it? WEll anyone who has worked with PERL will understand this. Courtesy compilers. They generate code behind your back. In this case the copy constructor and the = operator can be used to hold onto instances of the already created sound manager. Lets make them private. So finally: class SoundMgr { private: SoundMgr(const uint num_channels); // Instantiate the manager with number of channels for this sound card ~SoundMgr(); SoundMgr(const SoundMgr&); SoundMgr& operator=(const SoundMgr&); public: void PlaySound(const std::string& filename); // Dont worry about it void StopSound(const std::string& filename); // Dont worry about it static SoundMgr* GetSoundMgr(const uint num_channels); static void Destroy(); private: static std::vector sound_channels; // You can use an array. Then allocate the resources dynamically. Using this for simplicity. static SoundMgr* global_soundmgr; };