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

Igor Stasenko siguctua at gmail.com
Fri May 21 00:05:49 UTC 2010


On 20 May 2010 20:08, Andreas Raab <andreas.raab at gmx.de> wrote:
> 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
>
unless you wanna get rid of Project as well.. then you still have to write
(Smalltalk at: #Project ) blahblahblah

because Smalltalk, is the only global, which i am sure will stay with
us forever :)

> 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".
>
Indeed. Except that i'm not really happy with naming.
Using a Project  as a name is a bit counterintuitive.

Why it has to be responsible for answering an instance of Display
or morphic world?
I know, it is historically been so, but i wonder if there other (more
appropriate) dispathes.

Smalltalk graphics display
Smalltalk ui morphicWorld


> Cheers,
>  - Andreas
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list