[Home] [By Thread] [By Date] [Recent Entries]

  • From: Andrew Welch <andrew.j.welch@g...>
  • To: Michael Kay <mike@s...>
  • Date: Wed, 17 Jun 2009 14:12:54 +0100

>> First an example of a business rule:
>>
>>     A Level 1 manager has a maximum signature
>>     authority of $10K.
>>
>>
>>     An auto loan applicant, living in Ohio, is
>>     underage if he/she is under 18 years of age.
>>
>>     If a customer has no outstanding invoices,
>>     then the customer is of preferred status.
>>
>
> I agree those are business rules and are best kept out of a schema.
>
> What's more difficult are rules like "Every branch of the bank has a branch
> manager" - that's on the borderline between structural rules and business
> rules.

I've often wondered where you draw the line - do you check everything
possible in the xsd, or only in the application, or both.

There doesn't seem to be a simple answer, but a rough guide is: if you
don't want "branch manager" to ever be null, check it in the schema.
If however, you want a nice error message instead of one mentioning
"invalid content" and "complex type" then let it through to the app.



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member