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

Andreas Raab andreas.raab at gmx.de
Fri Mar 6 07:36:22 UTC 2009


nicolas cellier wrote:
> Sure. ++ for Announcements.
> But one thing just annoys me: uncontrolled proliferation of #is* messages.
> Why general Announcement framework should know about every specific annoucement
> for example implementing isMethodRemoval ?

Ah! But that's one of the points of using Announcements. You don't have 
to add it too high in the event hierarchy, since you can scope down to 
where you need it. E.g., consider this hierarchy:

Announcement
	SystemEvent
		CompilationEvent
			ClassCompilationEvent
				ClassAdditionEvent
				ClassModificationEvent
				ClassRemovalEvent
			MethodCompilationEvent
				MethodAdditionEvent
				MethodModificationEvent
				MethodRemovalEvent


Now, only CompilationEvent does need to know about #isMethodRemoval 
since you can do, e.g.,

registerForEvents

	SystemChangeNotifier
		on: CompilationEvent
		send: #prefEvent:
		to: self.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list