[squeak-dev] Re: Announcements?

Janko Mivšek janko.mivsek at eranova.si
Mon Mar 2 08:48:10 UTC 2009


Andreas Raab pravi:

> Thanks to everyone for all the info on announcements. For reference, I'd
> say the canonical URL is this one (as it links to the whole serious of
> posts about the topic):
> 
> http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework
> 
> I spent quite a bit of the weekend playing with Announcements and I like
> it even more now. One thing that convinced me is that it is almost more
> like a pattern than a framework - you can implement it with minimal
> effort (I did it just by writing about 100loc total) but grow it to suit
> ones needs[1].
> 
> [1] One of the things I quickly found was that I wanted the subscription
> from #on:send:to: returned in order to be able to control whether it is
> client-owned (weak for the signaler) or not. Turned out that this is
> really just a minor modification which fits the model just fine.
> 
> One thing I am wondering about is whether anyone out there has been
> using Announcements for frameworks that have a larger number of events.

The VW Pollock/Widgetry GUI framework (now abandoned) uses Announcements
for all UI events. Announcements were actually designed to support this
framework. This proves that Announcements are capable to support
environments with large amount of events.

We are also using Announcements in Aida/Web framework (VW port) to
signal events to other loosely coupled systems/plugins like BiArt/BPM
(for executing business processes). Aida sends event for every request
executing down its path (view shown, action triggered).

Business processes are also all about events, while on the other side
the web app is also full of events. Not to tie those two things too
closely is then achieved with event mechanism like Announcements.

Janko


> The framework I applied it to ended up with some 30 events (the total
> number of classes in the framework is about 70, but it is event-heavy)
> which at first seemed excessive but it *is* the number of events that
> are being used so at least people can find out whether there is an event
> for a change of foo or not. In that sense my original intuition proved
> true (lots of classes but you do get to document the events in your
> system). I am curious how people feel about this proliferation of classes.
> 
> The other thing that using Announcements extensively will probably force
> is name spaces. It seems impossible for two frameworks not to have a
> "ValueChanged" event. The precise definition of which will likely differ
> (for example, where I've been using it, it is critical that the signaler
> gets passed along with it; but I am certain there are some places where
> people don't want to pay for that slot).
> 
> In any case, I think announcements are a great improvement over the
> usual pattern of using event names instead of objects. You should
> definitely give it a try the next time you consider using an event
> framework.
> 
> Cheers,
>   - Andreas


-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si



More information about the Squeak-dev mailing list