[Pharo-project] Announcement real problems - please read and comment.

Henrik Sperre Johansen henrik.s.johansen at veloxit.no
Sat Apr 2 16:56:17 CEST 2011


On 02.04.2011 12:13, Stéphane Ducasse wrote:
>> PPS. There's a neat method called #on:send:to:,  which would be perfect for the different actions in RPackage-SystemIntegration.
> I'm trying to understand how this on:send:to: would help us.
> Because
> 	Nautilus registered to system announcer
> Now I do not understand why RPackageOrganizer should not register to systemAnnouncer too.
> And even if we use on:send:to: who can garantee that the on:send:to: will notify first the RPackageOrganizer and
> not that an announcement will reach the browser before.
>
> What was your idea?
>
> Stef
It has nothing to do with registration ordering, but using the proper API.
If you look at the RPackageOrganizer registrations in 
RPackage-SystemIntegration, all they do in the action block is send self 
a message.
Instead of:
anAnnouncer
         when: SystemCategoryAddedAnnouncement do: [ :ann | self 
systemCategoryAddedActionFrom: ann ];
you write:
announcer on: SystemCategoryAddedAnnouncement send: 
#systemCategoryAddedActionFrom: to: self

It also has the added benefit you can make them weak if you want :)

Cheers,
Henry

And ugh, why the Announcement at the end of the Announcement names? :/



More information about the Pharo-project mailing list