2016-04-26 20:16 GMT+02:00 Sven Van Caekenberghe <s...@stfx.eu>: > Making log events subclasses of Announcement and using an Announcer > instance local to a subsystem is one easy implementation choice, but not > necessarily the only one. > > One concrete (but not perfect) implementation of my ideas can be found in > the package 'Zinc-HTTP-Logging' in your image. >
I look at it. And I saw hierarchy of ZnClientLogEvent (9 classes) which is just data objects without any behaviour. For each class there is method in ZnClient with #log...thisEvent pattern. And most of this methods has only sender which executes real business logic on httpClient. For example: ZnConnectionEstablishedEvent ^ logConnectionEstablishedTo: url started: initialMilliseconds ^ newConnectionTo: url So for each event ZnClient has two methods. What I feel here is that if Zinc will be designed with some kind of command pattern all of this would be not needed. Instead of events and corresponding methods Zinc would have commands which implement real logic and can be logged directly without any special objects. I know designing http library is complex task. And maybe my idea is not applicable here. But what I want to say: applications usually already have objects which incapsulate all needed information for logs. And logging system should not require anything else.