[KCP] SystemChangeNotifications: Current state and some code

Colin Putney cputney at wiresong.ca
Mon Jul 21 15:40:27 UTC 2003


On Tuesday, July 15, 2003, at 08:49  AM, Martin Wirblat wrote:

>>
>> Event
>>   CodeModified
>>      ClassChanged
>>      ClassRenamed
>>      ClassAdded
>>      ClassRemoved
>>      MethodAdded
>>      MethodRemoved
>
> These names are misleading because one wouldn't think that such
> classes are events.

I would. Based on their names, what else could they possibly be?

>> This exact issue has come up recently on the list with the
>> introduction of the Deprecation exception. That class was originally
>> called DeprecatedException. This, I hope you agree, does not match
>> the feel established by the ANSI exceptions: DivideByZero and
>> MessageNotUnderstood, Halt.
>
> DivideByZero, MessageNotUnderstood and Halt imply or suggest some
> sort of Error. There is a difference!

No more than ClassRemoved suggests an event.

What's not really clear here is the difference between exceptions and 
events, which is the delivery mechanism. Both MessageNotUnderstood and 
ClassAdded are "events" in the broad sense of the term; programmer 
familiar with the Smalltalk idiom will infer that if he encounters an 
instance of one of these classes, the event must have occurred at some 
point in the past, and that the instance encapsulates the details of 
where and when. It does not tell him that one will be delivered to an 
#on:do: handler somewhere up the stack, and the other will be delivered 
to a callback method of the dependents of a certain object.

The good news is that if he wants to know about the delivery mechanism, 
he doesn't have to look far. Seeing the MNU is a subclass of Exception, 
while ClassAdded descends from Event will give him the clue he needs.

In short, I like the shorter names.

Colin



More information about the Squeak-dev mailing list