ReferenceStream, tree or graph?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ReferenceStream, tree or graph?

Mariano Martinez Peck
Hi folks. I have a question. Reading http://wiki.squeak.org/squeak/2318  it says:

"This is a way of serializing a tree of objects into disk file. A ReferenceStream can store one or more objects in a persistent form, including sharing and cycles."

I am confused. If it has cycles, shouldn't it be a graph instead of a tree?  I know this is subtle, but it is important for me. I want to know if ReferenceStream supports a graph of objects, NOT only a tree.

Does someone know?

Thanks

Mariano

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: ReferenceStream, tree or graph?

Lukas Renggli
ReferenceStream can store cycles.

> "This is a way of serializing a tree of objects into disk file. A
> ReferenceStream can store one or more objects in a persistent form,
> including sharing and cycles."

ReferenceStream does a pre-order traversal of the object graph.
Whenever it encounters an object that has been already serialized it
puts a special back-reference to that object. With this strategy you
essentially end up with a tree, if you do not look at these
back-references.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project