Re:Steve Yegge: Singleton Considered Stupid
by DanHulton on Tuesday May 27, 2008 @11:54AM
(#201088)
When writing a game, I tend to have a singleton "Game" or "World" class (well, actually a static class, I don't bother with all the getInstance() crap), and from there a bunch of proper classes all "owned" by Game. Now, I'm basically using static classes as a namespace here, but is this really that harmful? If so, what options do I have?
[ Parent
| on HN ]
I guess it will fly in your face once you'll try to create multiplayer games and serve several games at the same time?
What do you gain from making a game a singleton?
Well in that case, I'd have a Server class and a Client class. One handles logic and the other handles display and input.
And actually, for my last little prototype (now that I think about it), I didn't make it a singleton, I just had a single public instance of it.
Question retracted.