| 1 | COMMENTS on WCKER-wizard.xsd |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | Hello Dave, |
|---|
| 5 | |
|---|
| 6 | Just been checking through "WCKER-wizard.xsd". I've made some comments |
|---|
| 7 | on these to gain understanding for myself and hope that some are useful |
|---|
| 8 | for you: |
|---|
| 9 | |
|---|
| 10 | (1) Undefined Tags |
|---|
| 11 | ================== |
|---|
| 12 | |
|---|
| 13 | Some elements do not appear to be defined e.g. "manifestOverview", "title", |
|---|
| 14 | "PageSummary" and "defaultValue". I have not made a comprehensive list |
|---|
| 15 | of these though. Are these: |
|---|
| 16 | |
|---|
| 17 | (a) place-holder only elements i.e. structural |
|---|
| 18 | OR (b) intended to be defined later |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | (2) Choice of 1 ... inf for metadata - perhaps 0 ... inf ? |
|---|
| 22 | ========================================================== |
|---|
| 23 | |
|---|
| 24 | The wizard must have a metadata section. |
|---|
| 25 | |
|---|
| 26 | The metadata section must have an element from "http://purl.org/dc/elements/1.1/". |
|---|
| 27 | However, if this can be an arbitrary element then that arbitrary element may not be |
|---|
| 28 | worth bothering about, so should the choice occur from 0 to inf times instead |
|---|
| 29 | with the philosophy of no unjustifiable constraints and maximum flexibility. |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | (3) High Commonality between item and itemPattern |
|---|
| 33 | ================================================= |
|---|
| 34 | |
|---|
| 35 | The definitions of item and itemPattern are almost identical. |
|---|
| 36 | The major difference is that an item has additional but optional |
|---|
| 37 | fields, so actually it could be used to represent an itemPattern |
|---|
| 38 | as well. |
|---|
| 39 | |
|---|
| 40 | There are inline definitions of attributes e.g. : |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | <xs:attribute name="type" use="required"> |
|---|
| 44 | <xs:simpleType> |
|---|
| 45 | <xs:restriction base="xs:string"> |
|---|
| 46 | <xs:enumeration value="page"/> |
|---|
| 47 | <xs:enumeration value="container"/> |
|---|
| 48 | </xs:restriction> |
|---|
| 49 | </xs:simpleType> |
|---|
| 50 | </xs:attribute> |
|---|
| 51 | |
|---|
| 52 | should these be taken outside for clarity and/or be made elements? |
|---|
| 53 | |
|---|
| 54 | (4) High Commonality between question and questionGroup |
|---|
| 55 | ======================================================= |
|---|
| 56 | |
|---|
| 57 | Similar argument to above: repetition of form suggests restructuring |
|---|
| 58 | would benefit overall clarity. |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | (5) operatorType Missing from Diagram |
|---|
| 62 | ===================================== |
|---|
| 63 | |
|---|
| 64 | Appears in schema but not in diagram |
|---|
| 65 | |
|---|
| 66 | (6) Name Choices |
|---|
| 67 | ================ |
|---|
| 68 | |
|---|
| 69 | Some of the name choices are a bit confusing, for example |
|---|
| 70 | some are also significant names for XML Schema. |
|---|
| 71 | |
|---|
| 72 | (i) the name "attribute" within the definition of question is |
|---|
| 73 | confusing as this is an XML schema keyword! |
|---|
| 74 | |
|---|
| 75 | (ii) "optional" and "required" are user-defined attribute values, |
|---|
| 76 | but they are also attribute values in schema. |
|---|
| 77 | |
|---|
| 78 | (iii) title as an element and as an attribute. |
|---|
| 79 | |
|---|
| 80 | Of course (i) and (ii) are less confusing in a graphical representation. |
|---|
| 81 | Normal software engineering practice is to steer well clear of keywords. |
|---|
| 82 | |
|---|
| 83 | (7) Conclusion |
|---|
| 84 | =============== |
|---|
| 85 | |
|---|
| 86 | The comments I've made are from considering "WCKER-wizard.xsd" as a source file |
|---|
| 87 | i.e. with the goal of making this as compact and elegant as possible to reveal the |
|---|
| 88 | essential structure so it can be further worked on. |
|---|
| 89 | |
|---|
| 90 | If the schema was developed graphically then all developers need to work |
|---|
| 91 | on it in this way, and of course once one has committed to graphical |
|---|
| 92 | development then one cannot really go backwards. |
|---|
| 93 | |
|---|
| 94 | Is it intended that the wizard's XML is developed graphically |
|---|
| 95 | or textually - as I am wondering whether (and if so in what form) |
|---|
| 96 | people look at schemas in order to develop XML? I mean I guess |
|---|
| 97 | the schema is the ultimate reference but is it also the commonly |
|---|
| 98 | used one? |
|---|
| 99 | |
|---|
| 100 | The semantics of the WCKER schema should also be clarified. |
|---|
| 101 | Most can be inferred but the role of treeInput/fromSchema/ |
|---|
| 102 | manifestOverview in the functioning of the GUI should be made |
|---|
| 103 | clear. |
|---|
| 104 | |
|---|
| 105 | I could massage the schema to a more compact form. I don't know if this |
|---|
| 106 | would be a useful exercise - let me know. The current exercise of looking at |
|---|
| 107 | the schema with a view to elegance has been my way of gaining understanding |
|---|
| 108 | i.e. forcing one's brain to engage by giving it a task. Anyhow, it's probably |
|---|
| 109 | time to tackle your PNG flicker-book in SWT! |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | (8) PostScript: Where Does the Iteration Go in XML Schema? |
|---|
| 113 | ========================================================== |
|---|
| 114 | |
|---|
| 115 | A short digression into the XML schema notation. |
|---|
| 116 | |
|---|
| 117 | minOccurs and maxOccurs appear to be associated with "iterators" (i.e. all/sequence/choice) |
|---|
| 118 | but also with elements themselves. Should repetition be associated with elements themselves |
|---|
| 119 | (seems bad software engineering practice to me!) or with an enveloping iterators. Do the two |
|---|
| 120 | different mechanisms achieve the same end, and what is the interactive effect of using both? |
|---|
| 121 | |
|---|
| 122 | This discussion examines these issues. Take the typical piece of code below, it WOULD |
|---|
| 123 | be possible to do the repetition at any of the levels (a), (b), (c) or (d). Observationally, |
|---|
| 124 | repetition occurs at levels (c) - the iterator level and (d) - the element level. |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | <xs:element name="schemas"> (a) not here |
|---|
| 128 | <xs:complexType> (b) not here |
|---|
| 129 | <xs:sequence> (c) here |
|---|
| 130 | <xs:element name="schema" maxOccurs="unbounded"> (d) here |
|---|
| 131 | <xs:complexType> |
|---|
| 132 | <xs:attribute name="namespace" type="xs:anyURI" use="required"/> |
|---|
| 133 | <xs:attribute name="prefix" type="xs:NCName" use="required"/> |
|---|
| 134 | </xs:complexType> |
|---|
| 135 | </xs:element> |
|---|
| 136 | </xs:sequence> |
|---|
| 137 | </xs:complexType> |
|---|
| 138 | </xs:element> |
|---|
| 139 | |
|---|
| 140 | Iterators appear to be used both on <xs:choice> and <xs:all>. Presumably they could be |
|---|
| 141 | used with <xs:sequence>, but this is not likely to be useful. |
|---|
| 142 | |
|---|
| 143 | Overall it's a trifle confusing to see whether repetition should be related to the element or the |
|---|
| 144 | surrounding iterator. If the element itself is repeated then is like a <xs:sequence> or <xs:all>? |
|---|
| 145 | If <xs:choice> is repeated, are several choices made OR is the set to be chosen from enlarged? |
|---|
| 146 | |
|---|
| 147 | These ambiguities can be represented in small code examples below: |
|---|
| 148 | |
|---|
| 149 | Example 1 |
|---|
| 150 | ......... |
|---|
| 151 | |
|---|
| 152 | CHOICE minOccurs="1" maxOccurs="2" |
|---|
| 153 | A minOccurs="1" maxOccurs="2" |
|---|
| 154 | B minOccurs="1" maxOccurs="2" |
|---|
| 155 | |
|---|
| 156 | Possible Outcome 1 Possible Outcome 2 Possible Outcome 3 |
|---|
| 157 | ------------------ ------------------ ------------------ |
|---|
| 158 | |
|---|
| 159 | CHOICE CHOICE CHOICE |
|---|
| 160 | A1 A1 A1 |
|---|
| 161 | B2 B1 B1 |
|---|
| 162 | CHOICE CHOICE A2 |
|---|
| 163 | B1 A2 B2 |
|---|
| 164 | B2 B2 |
|---|
| 165 | |
|---|
| 166 | Example 2 |
|---|
| 167 | ......... |
|---|
| 168 | |
|---|
| 169 | ALL minOccurs="1" maxOccurs="2" |
|---|
| 170 | A minOccurs="1" maxOccurs="2" |
|---|
| 171 | B minOccurs="1" maxOccurs="2" |
|---|
| 172 | |
|---|
| 173 | Possible Outcome 1 Possible Outcome 2 Possible Outcome 3 |
|---|
| 174 | ------------------ ------------------ ------------------ |
|---|
| 175 | |
|---|
| 176 | ALL ALL ALL |
|---|
| 177 | A1 A1 A2 |
|---|
| 178 | A2 B1 B1 |
|---|
| 179 | B1 A2 B2 |
|---|
| 180 | B2 B2 B1 |
|---|
| 181 | |
|---|
| 182 | |
|---|
| 183 | In fact all these are equivalent by the nature of ALL, so there is |
|---|
| 184 | no ambiguity. |
|---|
| 185 | |
|---|
| 186 | Example 3 |
|---|
| 187 | ......... |
|---|
| 188 | |
|---|
| 189 | SEQUENCE minOccurs="1" maxOccurs="2" |
|---|
| 190 | A minOccurs="1" maxOccurs="2" |
|---|
| 191 | B minOccurs="1" maxOccurs="2" |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | Possible Outcome 1 Possible Outcome 2 Possible Outcome 3 |
|---|
| 195 | ------------------ ------------------ ------------------ |
|---|
| 196 | |
|---|
| 197 | SEQUENCE SEQUENCE SEQUENCE |
|---|
| 198 | A1 A1 A2 |
|---|
| 199 | A2 B1 B1 |
|---|
| 200 | B1 A2 B2 |
|---|
| 201 | B2 B2 B1 |
|---|
| 202 | |
|---|
| 203 | These are not equivalent, the most likely interpretation is 1 followed |
|---|
| 204 | by 2. The question can be reformed as: if SEQUENCE is iterated N times then is |
|---|
| 205 | each component repeated N times or the set of components repeated N times |
|---|
| 206 | or can there be arbitrary mixing? |
|---|