[squeak-dev] Project refactoring - need some feedback and criticism

David T. Lewis lewis at mail.msen.com
Sun Jan 31 03:19:28 UTC 2010


While working on making MVC reloadable, I found that PopUpMenu needed
some attention. PopUpMenu is in package ST80-Menus, but it is not an
MVC class, and is used widely in both MVC and Morphic projects.

I found what I think is a fairly reasonable way to deal with this,
but I'd like to hear some criticism before applying it to trunk. The
specific concern was that PopUpMenu has some logic that is MVC and
Morphic dependent, but that is not of any general utility and should
not be implemented in Project.

Here is what I did:

- Move PopUpMenu from ST80-Menus to Tools-Menus.

- Implement Project>>dispatchTo:addPrefixAndSend:withArguments: to allow
classes with MVC and Morphic dependencies to dispatch through Project
current to invoke appropriate methods.

- Remove explicit MVC and Morphic dependencies from PopUpMenu. Add the
MVC and Morphic methods to ST80-Tools and Morphic-Tools packages, and
invoke them through Project>>dispatchTo:addPrefixAndSend:withArguments:.

- In packages Morphic and ST80, add support for
Project>>dispatchTo:addPrefixAndSend:withArguments: and for the project
dependent parts of PopUpMenu.

Why this might not be a good idea:

Project>>dispatchTo:addPrefixAndSend:withArguments: relies on string
conversion and naming conventions to invoke methods.

Why this might not be so bad after all:

It works. It is fairly easy to understand. It provides a way to
prevent Project from accumulating a lot of implementation logic for
which it should not be responsible.

The updates are in the inbox, and if nobody thinks this is too horrible
I'll move them into trunk in a day or so.

Thanks,
Dave




More information about the Squeak-dev mailing list