[squeak-dev] Breaking dependencies on ToolBuilder-Kernel

Frank Shearar frank.shearar at gmail.com
Sun Jul 21 21:26:10 UTC 2013


A whole bunch of low level packages - Network, Graphics, and so on -
depend on ToolBuilder because of UIManager's #request:initialAnswer:,
#inform:, and so on.

This in turn causes transitive dependencies on Collections, Files,
Kernel, SUnit (!) and System and, in particular, causes a cycle
between Graphics and ToolBuilder-Kernel.

I propose adding a few new resumable exceptions to some low level
package (perhaps Kernel, perhaps something else) that would follow the
pattern of ReplaceExistingFileException. The base package would
contain the definition, and ToolBuilder-Kernel would decorate the
exception with default handlers. So, concretely, we'd have something
like

Notification subclass: #InformNotification.

InformNotification class >> inform: aString
    ^ (self basicNew initializeWithMessage: aString) signal

InformNotification >> defaultAction
    "*ToolBuilder-Kernel category"
    ^ UIManager default inform: message

This would allow Graphics (and other packages) to signal stuff, while
not depending on ToolBuilder.

This is a fair amount of work - 19 users of UIManager in Network alone
- and it's fairly noisy in that it'll touch quite a few classes. So
before I dive in and break everything again.... are we reasonably
happy with this approach? I'll wait until Tuesday or Wednesday before
starting this, just to let Chris Muller say "wait wait wait let's talk
about this first!" :)

frank


More information about the Squeak-dev mailing list