DavidRumins: tobalch2

File tobalch2, 7.1 KB (added by johnstod, 12 years ago)

COMMENTS on WCKER-wizard.xsd for Dave Balch

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