Yes I like your blog entry.
But my point is orthogonal :)

On Sat, Jan 21, 2017 at 11:19:24AM +0100, stepharong wrote:
Pay attention that Singleton should not be about access but time.

If you can by adding on instance variable avoid to need a singleton
then it means that it was not a singleton.

A singleton is often:
       you **CANNOT** have  two instances at the same time.

Many people do not use well singleton so watch out.

We have several variations of singletons in the Pharo codebase, some of which do allow multiple instances, some of which don't. But they are differentiated by names.

https://www.peteruhnak.com/blog/2015/12/06/singleton-variations/


Peter


Stef

On Thu, 19 Jan 2017 11:23:21 +0100, Siemen Baader
<siemenbaa...@gmail.com> wrote:

>Is there a trait to quickly create singletons in Pharo, along the
>way of the Ruby Singleton mixin?
>
>https://ruby-doc.org/stdlib-1.9.3/libdoc/singleton/rdoc/Singleton.html
>
>(and ideally also observer/observable, which I am going to need next..)
>
>-- Siemen



--
Using Opera's mail client: http://www.opera.com/mail/



--
Using Opera's mail client: http://www.opera.com/mail/

Reply via email to