Lukas Renggli a écrit :
The original code comes from OmniBrowser. I generalized and extended it a little bit, since I use it in several projects. The original idea of announcements comes from Vassili Bykov as described in http://www.cincomsmalltalk.com/userblogs/vbykov/blogView? showComments=true&entry=3310034894.
Ok thanks but What is the aim of Annoucements?
Have a look at Vassili's blog entry, he explains it much more in detail than I can do here.
Announcements are a clean and object-oriented replacement for the #change:, #update: and #triggerEvent: hacks in Squeak and other Smalltalk's.
Announcements can be used pretty much the same way as exceptions, except that they are not limited to the execution stack. Interested parties can declare their interest for certain events to an announcer:
announcer on: SomethingChanged do: [ :ann | ... ]
Whenever the owner of the announcer triggers an event, all the registered blocks are evaluated:
announcer announce: (SomethingChanged new foo: 12; yourself)
Since announcements are objects they can be passed around, they can carry data, and they can even modified during the announcement processing (veto-able announcements).
That's basically it.
Lukas
oops ok I haven't seen the link you given me sorry :-/