[squeak-dev] Observer pattern implementations

Levente Uzonyi leves at caesar.elte.hu
Fri Jun 7 12:58:36 UTC 2019

Hi Brenda,

On Mon, 3 Jun 2019, Brenda Larcom wrote:

> I am reviving some old code that relied heavily on Lukas Renggli's implementation of Announcements (many thanks to Lukas). Announcements still loads in Squeak 5.2, but it is marked as no longer maintained on Lukas' site and I
> cannot find a repository for it anywhere else, which makes me nervous.
> Since I am reworking my code, now is the time for me to switch if I'm going to. I searched for alternatives in the Squeak release, in SqueakMap, on the Squeak wiki, and via DuckDuckGo using these search terms:
>  *  Observer
>  *  Dependent (& variations)
>  *  Publish-Subscribe (& variations)
>  *  Callback
>  *  Event Dispatch
>  *  Self-Addressed Stamped Envelope (& variations)
> I have identified the following generalized options in this space:
>  *  Object dependencies (update, changed) - in stock image
>  *  Object events (when:send:to:, trigger:) - in stock image
>  *  Renditions of VisualWorks' Announcements (events are objects)
>      +  by Lukas Renggli based on Colin Putney's code from OmniBrowser & Vassili Bykov's blog post - not in SqueakMap; loads in 5.2 & passes its tests; as of 2009, Pharo intended to standardize on this implementation, and
>         they have some (extended) Announcements framework in their stock image now
>      +  AXAnnouncements by Levente Uzonyi and Kósi Balázs - not in SqueakMap; loads in 5.2 & has one warning about a deprecated message in its tests; ported from VW, so maybe there are Cincom copyright issues

Thanks for reporting this issue. It's fixed in Announcements-ul.2. 
(The package with the AX prefix in the same repository wasn't fixed).
The code was not ported from VW but written from scratch based on 
Vassili's blog posts about Announcements, so there should be no copyright 

We also have an unpublished port of Ducts[1] aka Plumbing if you're 
interested in that.


[1] https://github.com/newspeaklanguage/newspeak/blob/master/Ducts.ns

>  *  Signals (callbacks with constraints for usability) by Marcus Taeumel - in SqueakMap on the Web, but not in the catalog seen by SqueakMap Package Loader in 5.2; loads in 5.2 & fails one test
>  *  Bindings by Tobias Pape (this link doesn't work on Chrome on OS X Mojave; looks like maybe a two-way registration for mutual change updates) - not on SqueakMap; loads in 5.2 but fails its tests
>  *  Visual Smalltalk Events by Tim Jones (looks like a precursor to or alternative implementation of the Object events that are now in the default image) - in Goodies rather than SqueakMap; does not load in 5.2
>  *  Wandering Announcements by Keith Hodges (an extension to Lukas' Announcements that looks around nearby parts of a model to locate an object to handle an announcement) - not on SqueakMap; couldn't locate code
>  *  PostOffice by Peter Smet (looks like an alternative implementation of the Object events that are now in the default image) - not on SqueakMap; couldn't locate code
> And for completeness, I also found other packages that implement [parts of] this pattern, but are specific to a particular domain that doesn't help me:
>  *  Morphic event handling, for handling user interface events
>  *  OmniBrowser (now deprecated), for internal OmniBrowser events,
>  *  MQTT client, for subscribing to updates published by IoT devices
>  *  MVC, for user interfaces
> I have questions:
>  *  Are these all the generalized options for the Observer pattern and the relatives I listed as search terms?
>  *  Is there anywhere else I should look?
>  *  Did I describe each option correctly?
>  *  Does anyone know of a public URL for any of the options whose source or documentation I couldn't find?
>  *  Are any of these options, to anyone's knowledge, being actively maintained?
>  *  Is the Squeak community planning to standardize on any of the generalized options?
>  *  In the absence of additional information, I am leaning towards sticking with Lukas' Announcements, because of the performance comparison chart on the Signals page (which I am assuming is approximately applicable to Lukas'
>     Announcements as well as AXAnnouncements) and Pharo's standardization decision. Is there any reason that is not on the Signals comparision chart for me to prefer some other package?
> Before you ask, yes, I would definitely like to help the next person by updating the Squeak wiki so that it is easier to find and pick from these alternatives, creating a SqueakMap entry and ConfigurationOf for at least the
> one I choose, et cetera. I'll post a [DOCS] thread with my specific proposed wiki changes after I get feedback on the accuracy of the data above.
> Thank you for reading, and for any assistance you can provide!
> -- Bren

More information about the Squeak-dev mailing list