icubilla / jsonexserializer

Automatically exported from code.google.com/p/jsonexserializer
0 stars 0 forks source link

Support circular references #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Devise a way to write references to objects that have already been
serialized in the current serialization operation.

Each object has a distinct path from the root to itself.  Write that path
out as a reference to find the object on deserialization.

Example:

{ cust: { name: "Ted", orders: [ {id: "12345", cust: this.cust } ] } }

The 1st element of the orders collection has a reference to the customer
object.  This is a circular reference.  The path to the customer object from
the root object is the cust property.  If we call the root object "this",
then its path is this.cust.  Upon deserialization the cust object will be
created first, so when we are in the order element, it will have been
created at that point.

Original issue reported on code.google.com by elliott....@gmail.com on 25 May 2007 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by elliott....@gmail.com on 27 Jun 2007 at 5:08

GoogleCodeExporter commented 9 years ago

Original comment by elliott....@gmail.com on 10 Jul 2008 at 5:01