[squeak-dev] Singleton in Inbox

Levente Uzonyi leves at elte.hu
Wed Nov 17 04:06:33 UTC 2010


On Tue, 16 Nov 2010, Chris Muller wrote:

> I just published to the Inbox, the class I've been using as my
> Singleton superclass.  3 class-side methods, +1 new one for Squeak.  I
> like #current as the nomenclature because:
>
>  - it is aptly descriptive, the "current" singular instance of this
> class (which can be replaced, via #current:).
>  - The meaning of #default seems more ambiguous.  The default for what?
>  - #theInstance or #soleInstance seems to reject the notion of
> alternates, as if there is only "the one" eternal instance.
>
> Not a big deal, unifying the Singleton api can simply help with
> tidiness.  We could migrate various singletons to inherit the behavior
> from this one and get rid of their repetitious accessors, et al.

I like the idea. Parts of your mail (about the choice for #current) should 
be in the class comment.


Levente

>
> - Chris
>
>



More information about the Squeak-dev mailing list