[Pharo-project] About announcements
estebanlm at gmail.com
Tue Jun 5 02:38:53 EDT 2012
On Jun 5, 2012, at 6:17 AM, Santiago Bragagnolo wrote:
> Hi All!
> Im adding an announcer in my project, 'cause, in order to build a call graph, ill need to know about inferencer-stack movements. I was thinking, the meaning of it is to create an announcement object with it configuration for any push or pop of a stack that's similar to the runtime stack, these are a lots lots lots of objects proably with lesser optimization than BlockClosure. I was thinking in add extension methods that allow me something like
> self announce: [ StackPush new ] ifAnyIsInteresetedIn: StackPush.
> Well, i have two questions:
> a) Am i right?
No.. dispatch of events to those who are interested is already done.
when you suscribe using #on: anAnnouncement do: ..., or #on: anAnnouncement send: ... to: ... you are already declaring "I'm interested on anAnnouncement", and the dispatcher delivers appropriately.
> b) subscriptions variable at SubscriptionRegistry is an OrderedCollection, but is commonly accessed to get the subscriptors related with some concrete type, why not a Dictionary? is not faster than an OrderCollection in the tipical case of use? Ok, it could complicate calls like 'remove: subscriptor' but, commonly if you have the subscriptor, you have the Announcement type. Maybe the common ammount of subscriptors in a announcer is too little?
a dictionary of what? announcement->suscriptions?
More information about the Pharo-dev