Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe that your question is just the same as abstract vs. concrete, or key/value pair vs. structure, etc. I also think that it is not that specific to XML, as it would equally present itself to an OO programmer; or a database designer; asking about a best practice is the same as asking about the best religion...</p> <p>Let’s look at your options:</p> <p>Option 1 is a metamodel: it describes what a question is. Option 2 is a model: it describes what you’re asking. </p> <p>Option 1 is the sys schema in every database. Option 2 is the user defined schema in a particular database.</p> <p>Option 1 is "technical": is about IT folks building great infrastructure for questionnaires. Option 2 is all about the “business” the questionnaire is about.</p> <p>One issue is that <em>1</em> is more verbose than <em>2</em> (<strong>runtime overhead</strong>); <em>2</em> requires more upfront analysis about what are we asking (<strong>design-time overhead</strong>). <em>1</em> is better positioned to accommodate new questions or extending what a question is about, e.g. a difficulty level or how long it took to get an answer (<strong>extensibility</strong>). The XSD for <em>2</em> is self-contained and self-describing of how to properly consume an instance XML (<strong>usability of the spec</strong>).</p> <p>In my experience, ability to implement cheap, and manage change cheap, is very important (<strong>cost of ownership</strong>); unfortunately, these may also be perceived differently by providers and consumers of services. Finding that sweet spot, a practicable design - your question basically – will need to take more into account, along the lines I’ve tried to describe above.</p> <p>Strictly speaking to some of the issues you mentioned about Option 1: strong typing, as an example, could be alleviated by using simple choices or a substitution group. However, this kind of stuff will not substantially change any of what I said.</p> <p>Considering the above then, I’ll annotate your question, to put things right where they belong.</p> <p><em>Are there any general best practices for these kind of design decisions <code>see my reference in choosing a “religion”</code>, or an obvious reason why one approach would cause fewer headaches than the other <code>it all depends on many more things which you didn’t mention</code>, or does this really just depend on the particular set of data being represented and how it will be processed <code>yes, to a high degree</code>?</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload