Towards clean unloading Morphic (an idea)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Towards clean unloading Morphic (an idea)

Igor Stasenko
Hello,

i just thought, that in order to get down to a minimal kernel image,
it would be nice to move all Morphic globals into a shared pool.

Things like, World, ActiveWorld
could be placed into a MorphicPool class.

Then we can make an easy transition
1. add this pool to classes which using that global & recompile them

2. for classes, which should have no dependency from Morphic,
use a messages like

Object >> currentWorld
   ^ (Smalltalk at: #MorphicPool ifAbsent: [ self error: 'bummer' ])
currentWorld .

Then, i hope, you can unload the Morphic using MC and it will leave no
trace in an image (or at least less trace than usual ;).

Same could be applied to Graphics package (to get rid a Display global)

--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Towards clean unloading Morphic (an idea)

Andreas.Raab
On 5/20/2010 2:47 AM, Igor Stasenko wrote:
> Then we can make an easy transition
> 1. add this pool to classes which using that global&  recompile them
>
> 2. for classes, which should have no dependency from Morphic,
> use a messages like
>
> Object>>  currentWorld
>     ^ (Smalltalk at: #MorphicPool ifAbsent: [ self error: 'bummer' ])
> currentWorld .

I think that's the wrong way to deal with the problem. A polymorphic
implementation via Project works much better, i.e.,

Object>>currentWorld
        ^Project current world

and then

Project>>world
        "No worlds here"
        ^nil

MorphicProject>>world
        ^world

etc. Then you don't need any globals at all.

> Then, i hope, you can unload the Morphic using MC and it will leave no
> trace in an image (or at least less trace than usual ;).
>
> Same could be applied to Graphics package (to get rid a Display global)

And the same applies. The pattern should be "Project current display".

Cheers,
   - Andreas

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Towards clean unloading Morphic (an idea)

Hannes Hirzel
In reply to this post by Igor Stasenko
On 5/20/10, Igor Stasenko <[hidden email]> wrote:

> Hello,
>
> i just thought, that in order to get down to a minimal kernel image,
> it would be nice to move all Morphic globals into a shared pool.
>
> Things like, World, ActiveWorld
> could be placed into a MorphicPool class.
>
> Then we can make an easy transition
> 1. add this pool to classes which using that global & recompile them
>
> 2. for classes, which should have no dependency from Morphic,
> use a messages like
>
> Object >> currentWorld
>    ^ (Smalltalk at: #MorphicPool ifAbsent: [ self error: 'bummer' ])
> currentWorld .
>
> Then, i hope, you can unload the Morphic using MC and it will leave no
> trace in an image (or at least less trace than usual ;).
>
> Same could be applied to Graphics package (to get rid a Display global)
>
> --
> Best regards,
> Igor Stasenko AKA sig.

Hello
If have read all the other mails in this thread.
The proposal by Igo may be implemented with the means available.

Is there any strong reason not to move ahead with this?

Kind regards
Hannes

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project