[Development] RFC: unified data model API in QtCore

Thiago Macieira thiago.macieira at intel.com
Thu Jun 14 15:13:32 CEST 2018


On Wednesday, 13 June 2018 23:46:54 PDT Lars Knoll wrote:
> I’d leave XML out of this. It is difficult to integrate, as it has so many
> special features (entities, CDATA and lot of other things) making it a
> rather complex specification. But there are a couple of other formats that
> might fit a more generic data model. Yaml comes to my mind as an example,
> protobuf and flatbuffers might also be possible to stream into such a
> structure with some additional schema verification.

YAML, like CBOR, was designed with compatibility in mind. In fact, it's 
designed so JSON-YAML conversion is lossless in both directions. So YAML makes 
a lot of sense.

I don't know much about PB and FB, but from what I've seen it's meant to be a 
serialisation format based on an IDL you describe. It's closer to QDataStream 
than to JSON. From what I've seen, it makes no sense to merge those with the 
other three than it does XML.

> > I'm skeptical. What do you think?f
> 
> One option could also be that we have a common implementation, and then a
> very thin API wrapper for each of the formats on top that will enforce the
> format specific limitations and give you a fully typed API.

That was my original plan. The QCborValue backend can be reused for JSON as a 
thin wrapper API. There's just a lot of copy & paste.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Development mailing list