Hi Sven,
Thanks for pushing this.
For Beacon, you do not need the wrapper because that is meant for other objects that are not announcements. If you use the Wrapper you lose the type of the event. So, the integration can be even simpler and more powerful:
ZnLogEvent announcer
�� �� �� �� when: ZnLogEvent
�� �� �� �� do: [ :each | each log ]
�� �� �� �� for: #beacon.
Afterwards, we can listen to specific events only by using the Announcement filtering mechanism.
Taking a step back, indeed it is easy to write the code to integrate but it comes at the cost of indirection. Specifically for logging we want the overhead to be as cheap as possible, and for this reason, we want the integration to be as tight as possible.
If we look at it, all these three solutions have identical structure:
- there is an event (Log, Announcement)
- there is something like a broker through which the events are being triggered (LogDispatcher, Beacon,��ZnLogEvent announcer)
- there are bindings that do something concrete with the events (Logger, BoundedBeacon, AnnouncementSpy)
In the case of using Announcements, we can just have support for a central announcer in the image and the integration would be even tighter. For example, if ZnLogEvent would use this global announcer, rather than its own global announcer, it would be cheaper.
So, I think the main thing is just to agree on the transmission mechanism. As we have Announcements already, the question is why implement another one? Or, if it is a nail, perhaps a hammer is the right thing to use :)
Cheers,
Doru