Re: The stupidest design I ever saw

From: Peter Flynn <peter.nosp_at_m.silmaril.ie>
Date: Sun, 09 Apr 2006 22:13:26 +0100
Message-ID: <49tbnpFqioasU1_at_individual.net>


Marshall Spight wrote:
> Joseph Kesselman wrote:

>> Mikito Harakiri wrote:
>>>     <node id=0 parent_id=null label='A'>
>> Whatever that is, it isn't XML. XML attribute values must be quoted.

>
> Exactly. Once you put quotes around the attribute values, the
> design becomes really good,

Well, tolerably good. It's poor design to use the attribute name "id" for a value which may not be an XML ID, even though this may not be necessary to the design, simply because it's ambiguous and misleading. The ID data type is there for a purpose, and if it is not being used, then it is not a good idea to use a name which implies that it is.

Oh, and the node element tag should be an empty element.

> because text based formats are
> flexible and nice. You can just put in whatever you want.

Sadly, people do do just that :-)

> That's
> the right way to manage structured data. "Traditional" databases
> are no good, because tables are flat, and the real world is tree
> structured.

Some of it. A lot of my work consists in unwedging users from unpleasant places they have gotten themselves jammed into because someone told them the world was a tree, and they tried to apply this to a linear structure which was not tree-shaped.

> There are lots of structures that you can't express
> as a single table, like a linked list.
>
> Another advantage of text formats is that anyone can write a parser
> for them. You want as many parsers as possible; that way the
> market can decide on what variations of the format are acceptable.

Only if the market is well-informed. A deliberately mis-informed market makes a wonderfully blunt instrument for making your chosen format acceptable regardless of its usefulness.

///Peter

-- 
XML FAQ: http://xml.silmaril.ie/
"When all you have is a chainsaw, everything looks like a tree"
Received on Sun Apr 09 2006 - 23:13:26 CEST

Original text of this message