[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] How to do XML design, per Jackson Structured Design
- From: Michael Kay <mike@saxonica.com>
- To: "Costello, Roger L." <costello@mitre.org>
- Date: Thu, 21 Nov 2013 08:28:55 +0000
Yes, I read Jackson in the early 1980s and I'm sure it has influenced my thinking about data design and program design ever since; these messages seem very familiar and intuitive to me so I must have internalised them. They are also one of the reasons I always found SQL frustrating, since it masks the natural hierarchies in the data that can be used as the basis of program logic.
One thing that Jackson misses, though, is that there can be multiple hierarchic views of the data: this doesn't apply to the indexed sequential files he was originally working with, nor (directly) to XML, but it does apply when you extend Jackson to other fields.
Concerning (8) and wrapper elements: it's certainly true that adding wrapper elements will often make the programming logic easier. However, there is a downside, which is that there's a bumpier transition between single-valued attributes and multi-valued attributes; if you decide that from now on, people can have more than one phone number, or more than one name, or that books can have more than one publication date, then your existing data has to change if you add the wrapper element, but not if you don't. And the wrapper elements are redundant, since they can be added programmatically.
If I remember right, Jackson didn't really make a connection between data designed with sequence, iteration, and selection on the one hand, and EBNF-based grammars on the other. Clearly these are the same primitives EBNF uses. We know how to generate parsers from an EBNF description of the data structure, and such parsers are easily able to cope with mixed iteration, sequence, and choice, without needing explicit delimiters to be added. (An idea I floated once is to link XSLT processing to the content model defined in a schema, so if the content model is a sequence that includes a choice or an iteration, you get a kind of "apply-templates" processing mode that presents and processes the data according to this implicit structure. That idea, of course, comes straight from Jackson.)
Michael Kay
Saxonica
On 20 Nov 2013, at 23:18, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Folks,
>
> I am reading the book that Sean McGrath recommended [1] on Jackson Structured Design. Wow, I am discovering that this book is really about XML design (and it was written in 1979).
>
> Here are some fantastic things I've learned:
>
> 1. Böhm and Jacopini proved in 1966 that all programming problems can be solved by using only three program component types: sequence, iteration, selection.
>
> 2. Dijkstra has pointed out that data can be described by using the same types of component.
>
> 3. Design the data structure, then design the program to match the data structure.
>
> 4. The data structures control the program structure.
>
> 5. Design the data to model the end user's real world.
>
> 6. When the program structure is based upon the data structures, then the program is firmly established in the real world.
>
> 7. Programming technique is alien to the end user. The end user's demands start from the end user's real world. The program structure must reflect this real world.
>
> 8. Component types (sequence, iteration, selection) may be mixed. However, you must make sure that each XML element belongs to one and only one of the three component types.
>
> Examples:
>
> a. Good: BookStore consists of a list of Book elements.
>
> <BookStore>
> <Book>...</Book>
> <Book>...</Book>
> ...
> </BookStore>
>
> BookStore is of the iteration (list) type.
>
> b. Bad: BookStore consists of a sequence of Location and list of Book elements.
>
> <BookStore>
> <Location>...</Location>
> <Book>...</Book>
> <Book>...</Book>
> ...
> </BookStore>
>
> This is bad because BookStore is both an iteration and a sequence type. Don't mix component types in an element!
>
> c. Good: BookStore consists of a sequence of Location and Books element. Books consists of a list of Book elements.
>
> <BookStore>
> <Location>...</Location>
> <Books>
> <Book>...</Book>
> <Book>...</Book>
> ...
> </Books>
> </BookStore>
>
> Now BookStore is of the sequence type and Books is of the iteration (list) type. Each are of just one component type - good!
>
> Jackson Structured Design tells us how to do XML design. Neat!
>
> /Roger
>
> [1] JSP A Practical Method of Program Design by Leif Ingevaldsson
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]