Talk:Object serialization: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with 'Serializing object instances which have no state does not seem very meaningful. You could trivially satisfy this task in some languages merely by naming the objects. Meanwhile,…')
 
No edit summary
Line 6: Line 6:


[[User:Rdm|Rdm]] 20:25, 2 September 2009 (UTC)
[[User:Rdm|Rdm]] 20:25, 2 September 2009 (UTC)

:Try serializing an object graph; the inter-object links would be a reasonable piece of state. Or you could use the labels on the nodes as the state. I'd keep the construction short though; this is a serialization task, not a "build a graph" task after all. —[[User:Dkf|Donal Fellows]] 05:38, 3 September 2009 (UTC)

Revision as of 05:38, 3 September 2009

Serializing object instances which have no state does not seem very meaningful. You could trivially satisfy this task in some languages merely by naming the objects.

Meanwhile, when I think about this issue, a variety of possibilities occur to me, for state. We could even introduce stateful classes and then [by implication] the classes would also need to be serialized -- but I do not think most of the examples do anything like this.

Can we update this task with a little bit of state? Perhaps, we can add a method which reports the time the object was first created? Or would that break all the existing implementations and thus be a bad idea?

Rdm 20:25, 2 September 2009 (UTC)

Try serializing an object graph; the inter-object links would be a reasonable piece of state. Or you could use the labels on the nodes as the state. I'd keep the construction short though; this is a serialization task, not a "build a graph" task after all. —Donal Fellows 05:38, 3 September 2009 (UTC)