[Pharo-project] Wishes for new ClassBuilder (toon?)

Toon Verwaest toon.verwaest at gmail.com
Wed May 18 18:17:09 CEST 2011


The PlayOut classbuilder indeed separates this nicely. We have the 
distinction between the "installer" and the "builder". The builder uses 
an "installer" as a client and notifies it about stuff that happens.

For example we have an "anonymous subclass builder" that's implemented 
like that. It basically just ignores most of the notifications of the 
builder since it doesn't really do anything.

... but of course this means that you need PlayOut ;) You can get an 
image at http://pinocchio.unibe.ch/~tverwaes/PlayOut.tar.gz

caveats:
- At the moment that system doesn't validate everything yet like the old 
classbuilder (since I wanted to freely change classes with any name)
- it doesn't handle obsolete subclasses yet. Oh well ;)
- it's still intertwined with our slots implementation, so it relies on 
Helvetia. But that can/should/will be fixed without changing the API.

cheers,
Toon

On 05/18/2011 03:18 PM, Mariano Martinez Peck wrote:
> Hi guys. As part of the Fuel project, one of the things we want to do 
> (in fact, it is done) is to serialize classes. There want to have 3 
> possibilities:
> 1) Do something like DiskProxy where you only save its global name and 
> some selector to run when deserialing it
> 2) Really searialize the whole class (following method dictionary, 
> compiled methods, class pools and friend, etc) so that you can 
> deserialize it in another image where such class is not present.
> 3) Do the same as 2 but validating and installing the class in the system.
>
> For 2) what we want to do is just to serialize the class as any other 
> object. As a result, we get a Class instance. Nothing is validated, 
> nothing is added in Smalltalk globals, nothing is compiled. We do not 
> use ClassBuilder at all.
>
> For 3) we want to do 2) plus validating and installing the class in 
> the system. For validating I mean ALL the validations that the class 
> builder does when creating or modifying a class. And for "installing 
> in the system" I mean notify, put in Smalltalk globals, re compile 
> what is needed, etc...
>
> ClassBuilder seems to do 2) and 3) together. So, what I would love to 
> have in a new class builder is to have those two things separated. So 
> that I can say to an object ClassManager validate: aClass or 
> ClassManager installClassOnSystem: aClass.
>
> Do you think such thing is possible?  Right now going through 
> ClassBuilder and understand all the validations it does is really 
> complicated :(
>
> Thanks in advance,
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>




More information about the Pharo-project mailing list