[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
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|