Nasty Singletons

Published October 03, 2005
Advertisement
I stumbled across a 'debate' on Singleton Managers which sparked my interest.

After reading Enginuity I was a huge fan of the Singleton 'pattern' as it allowed me to circumvent the whole notion of OOP and access my data from everywhere. Unsuprisingly, I used it everywhere and in every way I possibly could because I thought it was 'neat'. It started out with my logger and eventually crept into every class I had that had any kind of management responsibility. Before I knew it everything was accessing everything else and my seemingly simple systems were so tied into one another that even a minor change would take hours to implement. It was, quite simply, a nightmare.

I'm not going to join this whole debate as I believe there's a time and a place for everything, but please please please, if you're going to use a Singleton then at least know WHY you're going to use it and be aware of the issues that you could create for yourself by misdesigning the system.
0 likes 3 comments

Comments

Muhammad Haggag
Washu's journal has pretty good posts on singletonitis.
October 03, 2005 09:34 AM
H_o_p_s
Indeed it does.
October 03, 2005 02:38 PM
Rob Loach
Static
October 03, 2005 09:56 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement