[Modules] unloading difficulties...

danielv at netvision.net.il danielv at netvision.net.il
Sun May 5 21:12:18 UTC 2002


Here are my initial experiences trying to make Celeste unload. Questions
are interspersed. I have read, though not all the documentation on the
website. If we want a guide that'll make it easy for people to join the
refactoring, some of them may merit answer in the documentation. I'll
gladly do the adding myself, if that's acceptable to it's maintainers
(Henrik?)

First, I noticed that Celeste has lots of requirements. Not surprising,
it's not small.

Then I noticed some of them come from peripheral pieces of code, like
MailNotifier, which is actually not used. Obviously, I need to break off
pieces into modules, and prioritize work. So first of all, I needed to
find out how to create new modules, that wasn't hard.
Q1: I've simply created a module with a path #(#Squeak #Network
#Applications #MailReader #MailNotifier) that's subordinate to
MailReader. I am not sure if this means that it's now a submodule, and
I'm not sure if I can unload them separately. My goals is to make
MailNotifier a Celeste goodie, not part of the package. What the right
thing to do? What's the relevant code to read?

After that, I needed to move MailNotifier into this new module. I tried
to edit the class definition, as I would to change categories. This
didn't work, it offered to create a new class. 
Q2: Why, is that the most common thing to do? when would I do that? 

By reading through the ModuleRefactorer class, I found out about 
mailModule moveName: #MailNotifier toModule: mailNotifierModule.
So I moved the class, and then I wanted to unload it. I decided not to
define it's prerequisites first. I did 
ModuleInstaller unload: self
on the module, it complained and offered to determine dependencies by
itself, warning this might not work.
Q3: When might it not work? what might be the bad effects?
I accepted, it worked, the class disappeared. In the ModuleExplorer,
however, the entry was still there, with the following printString: 
'#(''stray-Module'' ''bad parent, #2857'')'. It still has it's neighbour
refs, the other variables are emptied.
Q4: Huh? what happened, how do I fix it, how do I avoid it, or should I
just start reading code now?

A related comment - this image refactoring stuff seems to require
thinking about two directions - 
* Who depends on me, so I can unload them before I try to unload me
* Who do I depend on
Then it requires various code snippets/GUI tools for doing the required
refactorings themselves.
* Creating modules
* Moving code between modules
* Changing dependencies manually

The current documentation gives enough directions I could start, but it
doesn't spell all of this out, and it doesn't include all the code
snippets needed. We don't yet have GUI tools to do the work, but the
code itself allows the work to be done, if you know the invocations, so
step-by-step isntructions + all the snippets could let people work on
this easily. 

As I said, I'll be documenting what I do, in case that helps someone.

Daniel



More information about the Squeak-dev mailing list