[Modules] unloading difficulties...

Bergel Alexandre bergel at iam.unibe.ch
Mon May 6 09:29:04 UTC 2002


> 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? 


My first attemp was :
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Module fromPath: #(People Your New Module) forceCreate: true.
Module @ #(People Your Old Module) definedNames removeKey: #YourClass.
YourClass module: #(People Your New Module).
(Module @ #(People Your New Module)) addAssoc: (Association key: #YourClass value: YourClass exportIt: true.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

But this seems to work pretty well :

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
(Module @ #(Your Old Module)) moveName: #YourClass toModule: (Module @ #(Your New Module))
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



> 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.

This happens when you unload a parent module, and ask a path on a child module.


> 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. 

there is what I have done with ModuleTool, but I have to fix some bug...


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

Good

Alexandre

> 
> Daniel

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._
Bergel Alexandre  http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^



More information about the Squeak-dev mailing list