[Pharo-project] ReferenceStream, tree or graph?
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
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
participants (2)
-
Lukas Renggli -
Mariano Martinez Peck