[squeak-dev] Observer pattern implementations

Marcel Taeumel marcel.taeumel at hpi.de
Tue Jun 4 07:54:35 UTC 2019


Hi Brenda,

I just ran that benchmark again in Squeak Trunk using a recent VM.

Signals: 22 ms / 2 ms
Object dependents: 2389 ms / 0 ms
Object events: 4282 ms / 5 ms
Announcements: 46 ms / 0 ms

Best,
Marcel
Am 04.06.2019 02:06:24 schrieb Brenda Larcom <asparagi at hhhh.org>:
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 [http://wiki.squeak.org/squeak/1214] (when:send:to:, trigger:) - in stock image
* Renditions of VisualWorks' Announcements [http://wiki.squeak.org/squeak/AnnouncementsFramework] (events are objects)
* by Lukas Renggli [https://source.lukas-renggli.ch/announcements/] 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 [http://www.squeaksource.com/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
* Signals [https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/signals] (callbacks with constraints for usability) by Marcus Taeumel - in SqueakMap [http://map.squeak.org/package/9d91de11-d317-4d83-b7d4-2cb87a591d43] on the Web, but not in the catalog seen by SqueakMap Package Loader in 5.2; loads in 5.2 & fails one test
* Bindings [http://www.hpi.uni-potsdam.de/hirschfeld/squeaksource/Bindings.html] 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 [http://files.squeak.org/goodies/VSEvents.txt] by Tim Jones (looks like a precursor to or alternative implementation of the Object events that are now in the default image) - in Goodies [http://files.squeak.org/goodies/VSEvents.7Augu1259am.cs] rather than SqueakMap; does not load in 5.2
* Wandering Announcements [http://lists.squeakfoundation.org/pipermail/seaside/2008-April/017540.html] 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 [http://wiki.squeak.org/squeak/687] 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 [https://wiki.squeak.org/squeak/118], for handling user interface events
* OmniBrowser [https://wiki.squeak.org/squeak/5646] (now deprecated), for internal OmniBrowser events,
* MQTT client [http://wiki.squeak.org/squeak/63], for subscribing to updates published by IoT devices
* MVC [http://wiki.squeak.org/squeak/1767], 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 [https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190604/1f27ad2b/attachment.html>


More information about the Squeak-dev mailing list