[cap-talk] Singletons Considered Harmful
Raoul Duke
raould at gmail.com
Wed Mar 31 10:25:24 PDT 2010
On Wed, Mar 31, 2010 at 10:22 AM, Raoul Duke <raould at gmail.com> wrote:
> -> "When an object method calls another self-object method that uses
> private instance data, it effectively has an input which is not
> declared in its interface. This can be confusing; callers can no
> longer tell from the interface alone what resources the method might
> access."
p.s. yes, it is constrained to what members the object has, but it is
still unclear which of those members are going to be used. again,
hence the Single Responsibility Principle and such, but again that
doesn't always pan out in real life code unfortunately. this isn't
about invalidating the arguments about Singletons, this is me trying
to say that there is some food for thought the echos all the good
stuff like SRP about the global-to-an-instance nature of fields that
maybe unfortunately isn't enforced by most OO languages. [type
inference reports: molehill -> mountain]
More information about the cap-talk
mailing list