XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
How to measure the changeability of an XML Schema?

Hi Folks,

Yesterday Michael Kay made a fascinating statement:

I would expect that for most documents …
               but I can't quantify "most", so that's a fairly
              meaningless statement.

Ah, to assess a statement it is important to be able to measure (quantify) the statement.

Let’s take an example …

I would like to create an XML Schema that conforms to a list of principles. One of the principles is this:

Design the schema so it can be easily changed
              when requirements change.

How to quantify: “can be easily changed when requirements change”?

Assertion: If we cannot quantify how easy it is to change a schema, then the principle is meaningless. Or, flip it around: if we cannot quantify how resistant a schema is to change, then the principle is meaningless.

Do you agree?

Let’s see if we can identify a couple schema features that make changes hard.

Consider a schema that uses a large inheritance tree (derive-by-extension and/or derive-by restriction). A change to complexType ABC impacts every complexType under ABC. If a requirement change applies only to ABC and not to any of its descendants (or applies to a subset of its descendants), then the schema is resistant to changes.

Assertion: Inheritance trees are evil. They create schemas that are resistant to changes. The deeper the inheritance tree, the more brittle the schema. Want schemas that are easily changed when requirements change? Then don’t use inheritance trees.

Do you agree?

Next, consider a schema that declares an element XYZ to be mandatory (minOccurs="1"). If a requirement change says XYZ is optional, then XML instances that conform to the previous schema are suddenly invalid.

Assertion: Mandatory elements are evil. They create schemas that are resistant to changes. Want schemas that are easily changed when requirements change? Then don’t make elements mandatory.

Do you agree?

How to quantify these things? Start at a score of zero. For every complexType that is part of an inheritance tree, add minus one (-1). For every element that is declared to be mandatory, add minus one (-1).

Well, something along those lines.

What other things make an XML Schema hard to change?

/Roger

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS