How to store live objects in Monticello?

Bert Freudenberg bert at freudenbergs.de
Tue Feb 13 11:10:15 UTC 2007


On Feb 13, 2007, at 7:35 , Milan Zimmermann wrote:

> On 2007 February 12 08:06, Bert Freudenberg wrote:
>> A workaround would be to put that string into a method, and
>> unserialize the project into the class var in the class-side
>> #initialize.
>
> Yes, this is basically what I am trying to do now. Basically (sort  
> of ) a copy
> and paste from the live string into a method and adding ^'' around  
> (through a
> ByteArray and a few hoops, as I cannot just copy and paste).
>
> Speaking of copy/paste: When I do Alt-p on something like:
>
> (ProjectsToTestContainer getContainedProjectHolders at: 1) getProject
>
> It shows something like:
>
> a ByteArray(80 75 3 4 20....etc...)
>
> when the result is very long, it shows "...etc" at the end. Same if  
> I print to
> Transcript. Is there some way to force showing all the contents?

Use #storeString instead of #printString.

OTOH, a common way is base64 encoding your binary data into a string.

>> A totally hackish thing would be to include the project file in the
>> MCZ, which is just a ZIP archive after all, and when #initialize is
>> called on your class, walk up the call chain to find the Monticello
>> instance that initiated the load - peek into its innards to get at
>> the file ;-)
>
> Maybe not as hackish ;) I think this would allow a less "manual"  
> process when
> adding another project to test.

Well, it is a one-time hack because you cannot reproduce a similar  
MCZ by writing it out again.

- Bert -





More information about the Squeak-dev mailing list