Hi list,
I'm currently using announcements to get events and deciding to take a specific action when the announcement is delivered, based on a certain condition. As an example, suppose that I have a collection of handlers that respond to the #process: message in the following way: Handler>>process: anAnnouncement (self condition value: anAnnouncement) ifTrue: [self doSomething] Now I'm planning to use announcements in a distributed environment and is likely that the announcements producer and the handler live in different images. Since I want to avoid unnecessary network traffic, I would like to move the conditional part to the announcer itself, so that the check is performed before the announcement is delivered. So, my first question is: is this already implemented? In case not, I think that the way to go would be subclassing AnnouncementSubscription and defining this behaviour there. However, I see that AnnouncementSubscription has a WeakAnnouncementSubscription and messages like #beWeak, which I don't think I can respond to (unless I also define a subclass of WeakAnnouncementSubscription, which basically means duplicating the hierarchy). So, the new questions are: 1. Is subclassing AnnouncementSubscription the way to go? 2. If the above is true, shouldn't we decouple the fact that the reference to the subscriber is weak or not by delegation instead of subclassing? Thanks in advance, Andrés _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
On Wed, Feb 27, 2008 at 8:24 AM, Andres Fortier
<[hidden email]> wrote: > [...]. So, the new questions are: > > 1. Is subclassing AnnouncementSubscription the way to go? > 2. If the above is true, shouldn't we decouple the fact that the > reference to the subscriber is weak or not by delegation instead of > subclassing? Hi Andres, I'd say yes to both of the above, but could a filtering subscriber proxy work for you instead? I mean an object that would live in the same image as the announcer, subscribe to announcements, filter them and forward the interesting ones to the "real" subscriber in the remote image. Cheers, --Vassili _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Hi Vassili,
yes the proxy solution could do it, but since I'm digging in the announcements fwk I thought it would be nice to add this as an enhancement, that works local and remote (maybe it could be valuable in other contexts of use). As a matter of fact I guess that the simplest solution would be to add a Block to the AnnouncementSubscription and evaluate it before the announcement is delivered. This plus: - Provide a couple of new selectors in Object (e.g. when:if:do:). - Redefine the existing ones (e.g. when:do:) to call the conditional ones with a block that just returns true. should do it. The only drawback I find here is that many subscriptions would have a block that is actually of no use, but I don't know if that is such a bad thing. What do you think? Thanks for the reply, Andrés Vassili Bykov escribió: > On Wed, Feb 27, 2008 at 8:24 AM, Andres Fortier > <[hidden email]> wrote: >> [...]. So, the new questions are: >> >> 1. Is subclassing AnnouncementSubscription the way to go? >> 2. If the above is true, shouldn't we decouple the fact that the >> reference to the subscriber is weak or not by delegation instead of >> subclassing? > > Hi Andres, > > I'd say yes to both of the above, but could a filtering subscriber > proxy work for you instead? I mean an object that would live in the > same image as the announcer, subscribe to announcements, filter them > and forward the interesting ones to the "real" subscriber in the > remote image. > > Cheers, > > --Vassili > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |