I am using WDDX to to store a ColdFusion struct in a database, and I would like to maintain the pointers. Here's an example (sorry, the shorthand notation may be full of errors b/c I hardly ever use it):
tshirt={color={selected="red",options=["red","blue","yellow","white"]}};
tshirt.front= {colors=tshirt.color,design="triangle",ink="green"};
tshirt.back= {color=tshirt.color,design="square",ink="black"};
Right now, tshirt.front.color, tshirt.back.color and tshirt.color are all pointers to the same struct. If I change tshirt.color.selected to "blue", tshirt.back.color.selected and tshirt.front.color.selected will also be "blue".
However, suppose I WDDX tshirt and then unWDDX it. When I change tshirt.color.selected to "white", it is not changed in tshirt.front.color.selected or tshirt.back.color.selected.
Can anyone suggest another way to serialize and unserialize data that would preserve the pointers?
Just a few links that I've been using to research so far: