[X3D-Public] [x3dom-developers] x3d to json experiments & links of interest

Cecile Muller newsletter at wildpeaks.fr
Tue Jul 8 06:06:08 PDT 2014


Hi everyone,


Ah I'm glad to see some life reinjected in the JSON encoding, it's been one
of my pet peeves :)


Regarding "why JSON":

 - For better or for worse, JS is the lingua franca of the interactive web
for the forseeable future and JSON is its natural data format. That's why
when you encounter web APIs, they always have a JSON output, but it's
getting more rare to see XML output (the trend is even to often have both
JSON input & output instead of "form-encoded input + XML/JSON output").

 - JSON is also regarded as the "arbitrary data" format in databases (e.g.
MongoDB, PostgreSQL or Parse).



As for the format itself, I came to pretty much the same format as Kristian
in my experiments, with one key difference: the node type expressed as
"_type" instead of "type", for three reasons:

 - Classic and XML encoding don't need a type property, so the naming
difference reinforces that it's a special JSON-only property.

 - Nodes might already have a "type" property (I often have such a field in
my protos).

 - The property could be omitted when the type is obvious, but that's an
edge case.



It doesn't have to be everything for everyone and XML is great for many
things, although filesize is a non-issue because you'd use Binary if that's
a concern, not classic, X3D or JSON encodings. Even though people also do
compression based on JSON (e.g. msgpack or NYTime's Tamper), that is best
left up to the user to decide which he wants to use.



See you,
Cecile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20140708/44f41d28/attachment.html>


More information about the X3D-Public mailing list