Singleton pattern in D

Bill Baxter dnewsgroup at billbaxter.com
Fri May 11 10:25:15 PDT 2007


David Ferenczi wrote:
>> Final point: just make sure you actually need singleton.  I've seen a
>> lot of people using singleton for a single class, which would be more
>> efficiently handled by a static class.
> 
> Can you mention some godd and bad examples?
> 
> I use singleton pattern e.g. for the application class (command line
> interface), configuration class (configuration handling), an log class
> (logging).

Good ole Yegge comes through again here with another beautiful rant:
   http://steve.yegge.googlepages.com/singleton-considered-stupid


More information about the Digitalmars-d-learn mailing list