
26 Jan
2010
26 Jan
'10
7:34 p.m.
Stewart, Robert wrote:
More than one instance can lead to unwanted contention, failed synchronization, resource overallocation, etc. If one assumes a single instance, those things are easier to manage.
I still disagree with this. Just, don't type "some_expensive_resource r;". The programmer should be using a global access point. But even if we don't get past that: It doesn't require we have a singleton class. Imagine the global class I proposed existed. Just take your class and intrude it yourself, making it a singleton. Ta-da! Singleton -> Always intrusive Global -> Not always instruive , can be I think it's clear which is generally more useful.