Is this a good singleton?

Vladde Nordholm via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 14 04:51:16 PST 2016


On Sunday, 14 February 2016 at 07:16:54 UTC, Russel Winder wrote:
> On Sat, 2016-02-13 at 18:58 +0000, Vladde Nordholm via 
> Digitalmars-d- learn wrote:
>> [...]
>
> Following the ACCU consensus: there is never, ever a good 
> Singleton or reason to contemplate using one.
>
> Obviously though there are some good ones: about dialogues in 
> GUIs for example.
>
> The good/evil-ness of Singleton is definitely in it's use: most 
> people use Singleton wrongly, most uses should be banned. Hence 
> the ACCU consensus.
>
> It's all about coupling and mostly testability of code..

Thanks. I'm using David Simcha's singleton now.


More information about the Digitalmars-d-learn mailing list