[squeak-dev] Class cleanUp protocol

keith keith_hodges at yahoo.co.uk
Sat Feb 27 02:38:07 UTC 2010


> Hi -
>
> Apologies for the many commit messages but I've adopted Keith's  
> proposed cleanUp protocol for classes. After writing a few more  
> custom cleanups I was just to fed up with all of the magic lore in  
> this area. Instead, we now have a common cleanUp protocol:
>
> 	MyClass class>>cleanUp: aggressive
>
> This (class-side) method is called with an argument that indicates  
> whether to do aggressive, i.e., potentially destructive cleanup.  
> Doing aggressive cleanup will delete projects, change sets, uni- 
> classes and more. Gentle cleanup is expected to only flush transient  
> caches. If your class only has gentle cleanup you can simply implement
>
> 	MyClass class>>cleanUp
>
> By default #cleanUp: delegates to this method (similar to startUp/ 
> startUp: and shutDown/shutDown:). You can run cleanup by executing:
>
> 	Smalltalk cleanUp. "gently"
> 	Smalltalk cleanUp: true. "aggressive"
>
> There is probably still more cleanups but I've taken a first round  
> on adding those cleanups that I was aware about. Hopefully, we can  
> now put all the various magic cleanup methods in ReleaseBuilder and  
> Smalltalk to rest.
>
> Cheers,
>  - Andreas

I cant say I favour some of these design decisions

Smalltalk is a dictionary of classes. We were just talking about  
Smalltalk being overloaded.
SmalltalkImage represents the image, so if we are cleaning up the  
Image, it should go on there, shouldnt it?

Someone will need cleanUpAllExcept: <list of classes>.

I still think that the distinction between gentle and agressive, is  
better described with different selectors. We were originally  
implementing the freeSpace protocol, so we used #freeSomeSpace, for  
the gentle version. I can see that your version requires a less  
testing of whether or not a class implements a selector.

K.



More information about the Squeak-dev mailing list