An example from our config , where objects reference other objects, here an object which has an id=Tree_topics, which is referenced by that id , in another object:
<entitySetModel id="6">
<list id="7">
<admingui.clientconfig.model.entityset.EntitySetFromFreemind id="8">
<id>Tree_topics</id>
<name>Tree_topics.mm</name>
<freemindFile class="admingui.clientconfig.model.freemind.FreemindFilesManager$1" reference="4"></freemindFile>
</admingui.clientconfig.model.entityset.EntitySetFromFreemind>
..
<admingui.clientconfig.model.selector.Selector id="12">
<id>selector1</id>
<crossList class="linked-list" id="13">
<admingui.clientconfig.model.selector.EntitySetSelectorConfig id="14">
<entitySet class=".admingui.clientconfig.model.entityset.EntitySetFromFreemind" reference="Tree_topics"></entitySet>
..
</admingui.clientconfig.model.selector.EntitySetSelectorConfig>
For us (and probably some other folks) it would have several advantages to use that user-defineable ID as reference, instead of the number!
- makes it possible to make the config human read- and understandable
- config can even be modified manually, inserting new objects with unique id's which do not break the existing config, like with incremental ID numbering
- also a lot nicer (and should be faster) than xpath references
Besides, first we had another crazy idea:
- Wouldn't it rock if one could serialize an object graph to a spring XML config !?
That is, the generated file should instantiate the same object graph, when loaded by a spring application context
Could this be done with XStream ?
I guess there are some issues making this idea illusional, but many of these could probably be handled.
This would allow to have the whole config only in Spring format, and not a mixture like we currently have when the more data centric objects are serialized with XStream.
This would also help following user (we having the same problem):
http://www.nabble.com/Add-a-ConvertListener-to-XStream-td13806257.html#a13845506
following posting maybe relevant for the wished Advanced XStream.ID_REFERENCES marshall Mode:
http://www.nabble.com/(De)Serializing-to-more-files-and-keeping-references-between-objects-td12071710.html#a12071710
An example from our config , where objects reference other objects, here an object which has an id=Tree_topics, which is referenced by that id , in another object:
<entitySetModel id="6">
<list id="7">
<admingui.clientconfig.model.entityset.EntitySetFromFreemind id="8">
<id>Tree_topics</id>
<name>Tree_topics.mm</name>
<freemindFile class="admingui.clientconfig.model.freemind.FreemindFilesManager$1" reference="4"></freemindFile>
</admingui.clientconfig.model.entityset.EntitySetFromFreemind>
..
<admingui.clientconfig.model.selector.Selector id="12">
<id>selector1</id>
<crossList class="linked-list" id="13">
<admingui.clientconfig.model.selector.EntitySetSelectorConfig id="14">
<entitySet class=".admingui.clientconfig.model.entityset.EntitySetFromFreemind" reference="Tree_topics"></entitySet>
..
</admingui.clientconfig.model.selector.EntitySetSelectorConfig>
For us (and probably some other folks) it would have several advantages to use that user-defineable ID as reference, instead of the number!
Besides, first we had another crazy idea:
That is, the generated file should instantiate the same object graph, when loaded by a spring application context
Could this be done with XStream ?
I guess there are some issues making this idea illusional, but many of these could probably be handled.
This would allow to have the whole config only in Spring format, and not a mixture like we currently have when the more data centric objects are serialized with XStream.
This would also help following user (we having the same problem):
http://www.nabble.com/Add-a-ConvertListener-to-XStream-td13806257.html#a13845506
following posting maybe relevant for the wished Advanced XStream.ID_REFERENCES marshall Mode:
http://www.nabble.com/(De)Serializing-to-more-files-and-keeping-references-between-objects-td12071710.html#a12071710