<div dir="ltr">(I havent followed the work on QVariantMaps, I will give it a look).<div><br></div><div>Nyall, I know that to make it error free and mantainable, we will need some sort of metadata, which would require some work both to set it up and mantain it. </div><div>This dicussion starts from the benfits of having a schema. If the most of you don't consider it a valuable option, there's no need to dicuss possible implementation :)</div><div><br></div><div>I have various cases where I need to parse a project but I can't rely on QGIS libs (because of the system environment).</div><div><br></div><div>If I had to decide for a solution I would considera, as said before, some kind of metadata system, even something similar to doctests/docstrings (skipped by compilers) where every class partecipating (or willing to partecipate) to the serialization will declare it's sub-schema, and where it would put it (we are always in an infoset model, so it must declare it's parent).</div><div><br></div><div>A utility tool could parse the code and build the final, complete, scheme. This utility could build whatever kind of scheme (XSD, DTD, our own selfdescribing format).</div><div><br></div><div>Yes, this is an overhead for those working on the parts of the code that serialize to project, but I don't think this is so big compared to the benfits...</div><div>For sure we can't mantain a schema manually!</div><div><br></div><div>giovanni</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-30 11:46 GMT+02:00 Nyall Dawson <span dir="ltr"><<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 30 June 2017 at 19:44, Matthias Kuhn 🌍 <<a href="mailto:matthias@opengis.ch">matthias@opengis.ch</a>> wrote:<br>
> On 06/30/2017 11:32 AM, G. Allegri wrote:<br>
>>     Normally you start with a schema, and from that create xml. To me it<br>
>>     sounds pretty hard to keep a schema updated the other way around? As the<br>
>>     api can always add new/changed parts of xml in it?<br>
>><br>
>><br>
>> Even QgsProject won't know if a project is valid until all the delegated<br>
>> classes have tried to deserialize their own parts.<br>
><br>
> Are you aware of real-world problems that were caused by this?<br>
><br>
>><br>
>> I think this is a weak point in QGIS, and it doesn't depend on the<br>
>> serialization format obviously.<br>
><br>
> I think it's only XML that comes with all these metadescription systems<br>
> like DTD and XSD. I haven't seen anything similar for yaml and json.<br>
<br>
</span>Also, on a related note - I'd prefer to see more areas of code move to<br>
the approach of serializing/deserialising to QVariantMaps and using<br>
your recent work on auto converting the maps to XML. It's much less<br>
maintenance this way :)<br>
<span class="HOEnZb"><font color="#888888"><br>
Nyall<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></div></div></blockquote></div><br></div>