Re: [xml-dev] Equivalence of hierarchical and flat data formats

From
Peter Hunsberger <>
To
Roger L Costello <>
Date
2022-07-28T13:25:08Z
ID
<CAKsvBp-BEO1vq+7WAbpu=>
Thread
Re: [xml-dev] Equivalence of hierarchical and flat data formats
Consider the case where two of your books have multiple authors, in different orders.

Peter Hunsberger


On Thu, Jul 28, 2022 at 6:09 AM Roger L Costello <[email protected]> wrote:

Michael Kay wrote:

 

  • it's very easy to do a mapping that supports all the same retrieval queries, but doing a mapping that supports exactly the same set of permitted updates is well nigh impossible.
  • One of the issues here is ordering. As soon as you start representing relationships using primary and foreign keys, you lose any natural way of representing order in the relationship

 

I don’t understand. The following flat data format uses primary/foreign keys to implement nesting:

 

BookList.dat
Compilers Principles, Techniques, Tools               AUT01  Addison-Wesley               1986
Introduction to Compiling Techniques               AUT02  McGraw-Hill      1996
Economic Facts and Fallacies      AUT03               Basic Books        2011
Economics in One Lesson             AUT04               Harper & Brothers           1946

AuthorsList.dat
AUT01   Alfred V. Aho, Ravi Sethi, Jeffrey Ullman
AUT02   J. P. Bennett
AUT03   Thomas Sowell
AUT04   Henry Hazlitt

 

Suppose I want to update the list of authors. Specifically, I want to add “John Doe” to the beginning of the AUT01 author list:

 

AUT01   John Doe, Alfred V. Aho, Ravi Sethi, Jeffrey Ullman

 

That update operation seems pretty straightforward to me. What is the issue that I’m not seeing?

 

/Roger