Re: Can use of singletons denote poor project design?




Phlip wrote:
Daniel Parker wrote:

I don't really see how there are any special issues for writing unit
tests for singletons.

Someone on comp.lang.c++ just pointed out, very politely, "I think you just
like using global variables because you're lazy".

Interesting. Do you think the designers of Java were lazy by
introducing the concept of a default DateFormat singleton object
accessible by a DateFormat.getInstance() member? Do you have a better
idea?

Regards,
Daniel Parker
http://servingxml.sourceforge.net/

.



Relevant Pages

  • Re: Can use of singletons denote poor project design?
    ... Daniel Parker wrote: ... tests for singletons. ... like using global variables because you're lazy". ...
    (comp.object)
  • Re: Global variables
    ... >> Do you tend to rely on global variables, or do you shun them completely, ... > holding some state variables that is reachable via some relationship ... > solution" is dictated by the problem space rather than being a developer ... > Without Singletons, the actual instances one can reach via relationship ...
    (comp.object)
  • Re: Singletons
    ... > Ilja Preuß wrote: ... >> quite clear that Beck doesn't like Singletons. ... provide global variables in languages without global variables? ...
    (comp.object)
  • Re: Singletons
    ... >> Is that because he doesn't like singletons or because it's easier to ... >> use class variables? ... > The book has a chapter on a number of design patterns, ... > provide global variables in languages without global variables? ...
    (comp.object)