Singleton in Inbox

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Singleton in Inbox

Chris Muller-3
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.

 - Chris

Reply | Threaded
Open this post in threaded view
|

Re: Singleton in Inbox

Levente Uzonyi-2
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
>
>