Can someone explain SmartRefStream?
Bert Freudenberg
bert at freudenbergs.de
Fri Jan 4 18:20:20 UTC 2008
On Jan 4, 2008, at 4:26 , Jerome Peace wrote:
> I find I will not be able to read the project
> back into the test pilot alpha image. This is true
> even if the changes to the project are essentially
> null. And across some images true even for an empty
> project.
Projects are only meant to be "forward compatible", that is, newer
images will be able to read older projects, but older images may not
be able to read projects saved from newer images. If something
changes, a newer image would take care of providing "conversion
methods" that will transform the objects found in older projects to
their current equivalent.
> Often the stream reader will ask me for a modern class
> to replace the name of one I have in the image or some
> such. Which of course confuses me and leaves me
> guessing.
Projects do not store classes, only instances (except for scripted
etoys objects). Thus if a class is not found and no conversion method
was provided, it cannot be read.
>
> User story: When I have a project needing to be saved
> across images. I go out to a page and a repository.
> Read what is known about the conversion of projects
> from one image to another. Select from a downloadable
> library of helpful conversion tools each documented as
> to context in which it is useful.
> Create conversion files for what isn't covered. And
> then have the ability to convert projects round trip.
Well, that is an extension of what projects where meant to be.
They're not designed as a transport vehicle to move objects from one
image to another, but basically meant to be loaded by the same image,
or a direct descendent of it.
One thing that might work much better for certain applications is the
new "high-level" project saving code. It is in the OLPC image but not
yet enabled by default. Instead of simply serializing the object tree
it writes a high-level description (like, "there is a green circle
over here and a text there") that is not dependent on the actual
implementation - we intend to move to that project format because it
would allow to move content over even to the next system.
> Baby step question one: Can the various squeaks read
> each others "Empty" projects?
You'ld have to test. But there are no empty projects. A project is
basically the whole tree of objects rooted in the project instance.
To avoid saving out too much, I think a project is actually deep-
copied and pruned prior to saving.
- Bert -
More information about the Squeak-dev
mailing list
|