Fwd: [squeak-dev] An old gripe (or: SystemChangeNotifier + Announcements = Sanity?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: [squeak-dev] An old gripe (or: SystemChangeNotifier + Announcements = Sanity?)

cedreek
another change in the air ;)
http://www.nabble.com/-squeak-dev--An-old-gripe-(or%3A-SystemChangeNotifier-%2B-Announcements-%3D-Sanity-)-td22366484.html

---------- Forwarded message ----------
From: Andreas Raab <[hidden email]>
Date: 2009/3/6
Subject: [squeak-dev] An old gripe (or: SystemChangeNotifier +
Announcements = Sanity?)
To: The general-purpose Squeak developers list
<[hidden email]>


Folks -

While doing some preferences stuff I ran into one of my "most-hated"
issues in Squeak. Anyone who has ever encountered SystemChangeNotifier
must have noticed how terrible it is to use it. I mean, just look at
this code:

prefEvent: anEvent
       "Check if this system event defines or removes a preference."
       (anEvent itemKind = SystemChangeNotifier classKind and:
[anEvent isRemoved]) ifTrue:[...].
       anEvent itemKind = SystemChangeNotifier methodKind ifTrue:[
               (anEvent isRemoved or:[anEvent isModified]) ifTrue:[...]
               (anEvent isAdded or:[anEvent isModified]) ifTrue:[...]
       ].

just needless, pointless lines of case statements. How do people feel
about replacing that mess with Announcements? If you really want to
have all events you register for SystemEvent and if you'd like to be
more specific you go for more specifically for ClassEvent or even more
specifically for ClassAddedEvent. It would also remove the need for
all of these weird tests like

       anEvent itemKind = SystemChangeNotifier methodKind and:[anEvent
isRemoved]

and just replace them with something like "anEvent isMethodRemoval".
It would likely be faster too, since most places aren't really
interested in *all* events either.

It would mean that Announcents would have to go core but this cleanup
alone seems worth it. I also suspect that adding Announcements and
fixing SystemChangeNotifier may remove more code than it would add.

How do people feel about that?

Cheers,
 - Andreas





--
Cédrick

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project