Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Singleton vs. static class

Name: Anonymous 2008-05-07 20:13

It seems all the object-oriented design guidelines say that if you want only one instance of a class to exist at any time, you should use a singleton. My question is, what are the advantages of using a singleton over simply using a class where all the member variables and methods are static?

Name: Anonymous 2008-05-07 20:45

So what's with the stateful vs. stateless argument? What makes static classes stateless, when they can hold variables just fine? Is it some old convention that declares that you shouldn't have static classes hold state, even though nothing prevents them from doing so?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List