[Tutor] What are "singletons" good for?

Steven D'Aprano steve at pearwood.info
Mon Sep 20 01:50:04 CEST 2010


On Mon, 20 Sep 2010 02:09:37 am Alan Gauld wrote:
> "Steven D'Aprano" <steve at pearwood.info> wrote
>
> > < much sense about singleton v global>
> >
> > and think this makes their code "better". (I blame the Go4 for
> > making a
> > religion out of design patterns which exist only to work around
> > Java's
> > limitations.)
>
> In fact the original design patterns were based around Smalltalk's
> limitations since most of the Go4 were/are Smalltalk hackers. And
> thus the Singleton - because Smalltalk has no concept of global
> variables.
>
> The book was registered in 1994 and released in 1995, a full year
> before the first Java JDK was made publicly available.

Fair enough, I stand corrected. Thank you.

Nevertheless, the design pattern book has been picked up by the Java 
crowd and elevated almost to the status of a religion, rather than a 
set of useful tools. Especially the Singleton pattern, probably because 
it's the only one which most programmers can understand *wink*



-- 
Steven D'Aprano


More information about the Tutor mailing list