Discussion
Rob Tweed · Dec 16, 2020

XML and JSON: Some further options

There's been quite a bit of discussion lately in this forum on the tools available in IRIS for using both XML and JSON, and debate on cross-conversion between the two formats.

A week or so ago I posted details of a set of tutorials I'd put together on integrating the Node.js-based QEWD technology with IRIS, working over a network.  As part of that set of tutorials, I've been detailing how to use the various multi-model capabilities of the build-in QEWD-JSdb abstraction of IRIS.  QEWD-JSdb is a key part of QEWD, and understanding it is key to understanding how to develop applications (REST and interactive) with QEWD.

So there's an initial tutorial on the basic "persistent JSON* abstraction:

https://github.com/robtweed/qewd-starter-kit-iris-networked/blob/master/...

and also two straightforward but interesting models:

LISTS: https://github.com/robtweed/qewd-starter-kit-iris-networked/blob/master/...

Key/Object Store: https://github.com/robtweed/qewd-starter-kit-iris-networked/blob/master/...

But the one I want to draw your particular attention to, in the context of the discussions on XML and JSON, is the persistent DOM Model.  This is based on the W3C XML DOM API, but instead of in-memory XML DOM manipulation, QEWD-JSdb's DOMs are persistent, their data stored in IRIS, and yet exposed in Node.js as JavaScript Objects with associated properties and methods.

Don't assume that just because the DOM and its basic APIs are based on the XML DOM that it's somehow limited to XML storage and manipulation.  The integrated XPath functionality, user customisation of DOM storage using "userData*, and the ability to map JSON to and from the QEWD-JSdb persistent DOM mean that it's actually a very powerful and sophisticated way of storing any inherently hierarchical data, in a way that can be manipulated, transformed and queried easily and powerfully.  The DOM tutorial is something of a monster because I wanted to do the capabilities justice and bring all its features to peoples' attention.

The persistent DOM is a perfect use of IRIS data storage combined with JavaScript.  I'd encourage everyone to take a look.  The full tutorial is here:

https://github.com/robtweed/qewd-starter-kit-iris-networked/blob/master/...

If nothing else, reading and trying out my tutorials will be a great way to spend the coming days of the holiday season!

Enjoy! 

Rob

 

30
1 0 1 133
Log in or sign up to continue

Replies