W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2002

Re: which way is correct?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Sat, 7 Sep 2002 08:55:16 +0100
Message-ID: <1238111681.20020907085516@jenitennison.com>
To: "Y. Han" <yhan@uwo.ca>
CC: xmlschema-dev@w3.org

Hi,

> Now I have two choices. The first one is
[snip]
> The first one is nested , while the second is seperated. Which one
> is correct? or both are correct?

You actually have three choices -- the third choice is to declare the
elements globally and have anonymous (nested) types. These design
patterns are known as "Russian Doll", "Venetian Blind" and "Salami
Slice". You can learn more about them and their advantages and
disadvantages at:

  http://www.xfront.com/GlobalVersusLocal.html

My personal preference is to use a "Venetian Blind" pattern for most
of a schema, with elements declared locally where possible and types
declared globally. I don't think that the "Russian Doll" pattern is
particularly good, except for very small schemas, because it leads to
schemas that are hard to read (you lose track of where you are) and
hard to extend/redefine by others. But as with most things, a
judicious mix is probably the best policy.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Saturday, 7 September 2002 03:55:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT