[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Are people really using Identity constraints specified in

  • To: <xml-dev@l...>
  • Subject: RE: Are people really using Identity constraints specified in XML schema?
  • From: "Roger L. Costello" <costello@m...>
  • Date: Fri, 20 Aug 2004 09:10:50 -0400
  • In-reply-to: <1092968133.41255ec53af69@m...>
  • Thread-index: AcSGW8PmIn0KMG8yS92P6to5lVzOIwAVPBJQ

typical constraints
Hi Folks,

A few more thoughts.

1. Constraint Volatility: constraints range from highly dynamic business
rule constraints to static data constraints.

2. Constraint Stack: there are advantages to creating "layers of constraint
checking" based on the volatility of the constraints:

    a. Simpler design: since each layer has a 
       focused  set of constraints that it must
       address, this leads to simpler schemas.
    b. Improved Change Management: since volatile
       constraints are isolated it is easy to 
       replace them with new versions. 

[Analogy: the "constraint stack" is analogous to the 7 layer OSI Model.
Each layer of the model addresses specific concerns.]

3. Multi-Schema Design: the current practice is to create one schema to
implement all constraint checking[1].  Preference should be given to
multi-schema designs.

4. Typical Constraint Stack: below is a typical constraint stack. The higher
layers implement volatile constraints.  The lower layers implement static
constraints.

    Java (layer #4)
    Schematron (layer #3)
    XML Schema (layer #2)
    XML Schema (layer #1) 

Example:

A company has employees.  This is the current company policy with respect to
employee age requirements:

    - the minimum age of an employee must be 16.
    - employees under 18 must have parental consent.

Here is the constraint stack:

Java (layer #4) implements the constraint:
     verify that the employee has provided a value for <age>

Schematron (layer #3) implements the constraint: 
     IF <age> is less than 18 THEN exists(<parental-consent>)

XML Schema (layer #2) implements the constraint:
     verify that <age> is at least 16

XML Schema (layer #1) implements the constraint:
    verify that <age> is a nonNegativeInteger

Naturally, feel free to replace XML Schema with RelaxNG, Schematron with
XSLT, Java with C, C++, etc.  It is the layering approach that is of
importance, not the specific technologies employed.
 
Comments?

/Roger

[1] Importing/including other schemas is effectively a one schema strategy.



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.