Re: Argument for 1NF by counter-example
Date: 26 Oct 2004 06:05:30 -0700
Message-ID: <bcb8c360.0410260505.776d60e6_at_posting.google.com>
"Dawn M. Wolthuis" <dwolt_at_tincat-group.comREMOVE> wrote in message news:<clhpuu$qtn$1_at_news.netins.net>...
> I definitely disagree with Pascal and others on the matter, although there
> are some points with which I agree. XML is only a format for data -- not
> brain surgery. Being against it is like being against comma-delimited text.
Indeed. But being against the misapplication of a fairly dodgy idea because it's the latest fad seems eminently reasonable. The only people I can think of who will genuinely rub their hands with glee at the acceptance of XML are sellers of disk space and network bandwidth, given XML's signal to noise ratio (almost as bad as Usenet ;)
> XQuery is a dog-ugly (from my perspective) format with which XML can be
> queried.
There doesn't seem to be much that can be done with XML that *isn't* dog-ugly. So why are we bothering with it ? My worry is that some very bright people, like Phil Wadler, are getting involved with it - and if anyone can drag XML kicking and screaming into near usefulness, it's Wadler.
> However, XML and XQuery can help get a job done that is not as
> handily done by other means and it has helped with data exchange and
> determining standards for such.
Hmmm. For me, the jury is well and truly still out on all of the above statements, and the foreman isn't smiling.
> What you get with XQuery is a language that
> can do what SQL cannot if I am understanding it correctly. I have not used
> XQuery in any production application and have only played with it for less
> than four hours time.
>
Unfortunately it's easy to get carried away with enthusiasm with these things on the basis of a quick play with some fairly trivial cases - I know, I get enthused and have to rein myself in by applying the latest Jolly Wheeze to a real-life situation. Enthusiasm dwindles shortly afterwards.
(Side note: why does the IT industry still pursue fads and trends like an idiot dog chasing after cars, with boundless energy, no reflection and the high likelihood of disaster ?)
> My impression is that XQuery permits me to look at data as sets and as
> di-graphs. This gives me more ease of use than if only thinking in terms of
> sets. For example, I don't have to think of joining a table to itself in
> order to get the names of the (human) children of parents, but can navigate
> as if clicking on a parent's name and getting their childrens' names. You
> can, therefore, search for for a particular node and, once there, gather all
> related data values.
This is possibly the most crucial paragraph in all of the recent writings in this group ! The fundamental question is :
Navigation : for or against ?
If you're for it, you aren't going to be a fan of relations : too little control, too much handed over to a DBMS you can't get a grip on, too many decisions taken by an optimiser you can't override. If you're against it, and would rather declare what you want as your result set and let a DBMS work out how best to get it for you, then you'll be comfortable dealing with an RDBMS. SQL DBMS' will get you some way there, but not the whole hog. Unfortunately, I find that most programmers want to navigate; they almost want life to be difficult and find the most awkward way of doing things they can. Hence the reappearance of pointers and the like in SQL:2003.
> Can the same data be retrieved using SQL(-92) if the
> XML document is in (old style) 1NF? Sure, but it isn't as intuitive to the
> average person nor as easy. If you give me a set-based tool then I have to
> think in sets, but if you give me tools that permit me to think in sets or
> di-graphs, so much the better. I'm sure I have not stated this to your
> satisfaction (yet?).
>
Perfectly, to my satisfaction. I just think that dealing with sets declaratively is so much quicker in terms of my time than specifying navigation paths through data. However, you do have to *get* thinking in sets first, and it was a couple of years of doing really horrible SQL (and a session with someone who knew how to handle set based thinking) before it clicked with me.
Cheers,
- Tony
