How to store live objects in Monticello?
J J
azreal1977 at hotmail.com
Mon Feb 12 18:18:32 UTC 2007
But I don't think that is what he is asking.
Smalltalk gives us a new way to develop. I often make some class for
something, create the display code for it, but I don't get around to making
code to instantiate the objects. Instead I just go in a doit or something
and make my objects from there and manually insert them where they need to
go.
This is a *major* speed increase from any other system I have ever used
because in a "cult of the dead" language I have to either (a) create a
throw-away method that makes the instances I need or (b) stop my train of
thought and go build an interface for making the objects.
But given this power, I use it fairly often. So the question I think he
has, and I know I have had is, how do I put this in a format that I can
export to another image? In my case it happens to all be web stuff, so I
will (at some point) install magma and then I expect to be able to just
switch images and everything work.
>From: Matthew Fulmer <tapplek at gmail.com>
>Reply-To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Re: How to store live objects in Monticello?
>Date: Sun, 11 Feb 2007 22:27:08 -0700
>
>On Sun, Feb 11, 2007 at 10:07:48PM -0500, Milan Zimmermann wrote:
> > Hi,
> >
> > I am trying to do something like this: I have a class LoadProjectTest
>that is
> > essentially a singleton and the LoadProjectTest class is in category
> > eToys-Tests. I'd like to do something like this: In the image where this
> > class originates, I am creating the instance, and setting one instance
> > variable with some value from a local file. I'd like the instance to be
> > stored in Monticello, when I "save" the category. Then, when the MCZ is
> > loaded into another image, the instance would be there, filled with the
>value
> > as created in the originating image.
> >
> > However, when I load the MCZ into another image, the instance is null;
> > although I was assuming otherwise, that makes sense as the Monticello
> > repository stores code not live objects.
> >
> > Is it possible to, somehow, to make Monticello to keep the instance, so
>it is
> > deserialized from the MCZ when the MCZ is loaded into the target image?
>
>You would write some class initialization code that creates this
>instance, and stores it where you see fit. Put your code in the
>class-side initialize method.
>
>A good example of a code that does just that is the class
>ExternalType in category FFI-Kernel. Look at the methods in
>category "class initialization"
>
> > Thanks Milan
>
>Hope it helps.
>
>--
>Matthew Fulmer -- http://mtfulmer.wordpress.com/
>Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
>
_________________________________________________________________
Search for grocery stores. Find gratitude. Turn a simple search into
something more.
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG
More information about the Squeak-dev
mailing list
|