[Opensim-dev] JSON or XML for serialization in the OpenSim database?
Justin Clark-Casey
jjustincc at gmail.com
Mon Jul 5 00:28:39 UTC 2010
Hi folks,
As part of the media-on-a-prim implementation, I'm serializing the parameters for a media texture to the database. This
seems better than creating new database fields or even a whole new table for these parameters, both because there are
lots of them (url, scaling, controls, whitelist, etc.) and because different future virtual environments may want to
store different things.
I'm going to serialize them as an OSDArray or MediaEntrys using the libopenmetaverse library. However, the question
then becomes whether to use the JSON representation or the XML representation.
I tend to prefer XML for storage representations. I believe that it's somewhat more human readable and that there is
better tool support for manipulating it. However, I know other people would prefer storage in JSON and I accept that
serialization/deserialization there may be slightly faster.
The only other example of serialization that I know of in OpenSim currently is that of SceneObjectGroups into inventory,
which encompasses object properties, object inventory properties and script state. This is done in XML and media
entries would become part of that serialization.
If there's a majority preference for JSON I don't mind using that instead, though I would want a justification for going
this route rather than XML. If there's no real argument then I will go with XML.
Also, I believe that we should try and be consistent, so picking one or the other now should make it more likely that
the same approach would be used for the next serialization case.
Regards,
--
Justin Clark-Casey (justincc)
http://justincc.org
http://twitter.com/justincc
More information about the Opensim-dev
mailing list