【发布时间】:2023-04-04 15:10:01
【问题描述】:
我正在使用 WDDX 将 ColdFusion 结构存储在数据库中,并且我想维护指针。这是一个示例(抱歉,速记符号可能充满错误,因为我几乎从不使用它):
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"};
现在,tshirt.front.color、tshirt.back.color 和 tshirt.color 都是指向同一个结构的指针。如果我将 tshirt.color.selected 更改为“蓝色”,tshirt.back.color.selected 和 tshirt.front.color.selected 将也是“蓝色”。
但是,假设我 WDDX tshirt 然后 unWDDX 它。当我将 tshirt.color.selected 更改为“白色”时,tshirt.front.color.selected 或 tshirt.back.color.selected 不会更改.
谁能建议另一种方法来序列化和反序列化数据以保留指针?
到目前为止我一直在研究的几个链接:
【问题讨论】:
标签: pointers struct coldfusion coldfusion-9 wddx