Jon Stewart on 29 Jul 2003 02:03:37 -0000 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [ALACPP] Thoughts on last night's code sample |
> For this purpose, the name would perhaps have better been something like > EventHandlerChainSocket (too long). They aren't really events - they're place > s > to hold the set of registered observers of events. However, they aren't reall > y > event handlers either - those would be the actual functions called (eg, > putOutFire). We never did find a good name that made us happy, so we just > called them EventHandlers. This is why I think Chris prefers EventDispatcher. To the code triggering the event, it makes sense as a good name (tell the dispatcher to send the message) and to the registration code, it makes a good name (register the handler with the dispatcher). > Basically, EventHandlers served to provide a place to register delegates. > Incomming net messages were deserialized, and then transformed into events > (calls to the corresponding EventHandler), via lookup on the MessageID. The > EventHandler itself was completely unaware that it was involved in network > traffic (as were the delegate functions that it called): it just knew that an > event had occured, and the args were on the stack. Among other things, this > made it really easy to test: only the outermost tests had to involve a networ > k > at all. Yes. Those who came on Thursday night heard me extoll the virtues of "decoupled notification" for testing purposes. :-) I think it's almost important enough to warrant a paper or something, but I could be wrong. Jon -- Jon Stewart stew1@xxxxxxxxxxx _______________________________________________ alacpp mailing list alacpp@xxxxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/alacpp