Lists Home |
Date Index |
> Here are some thoughts:
> 1. Constraints on data are not equal to business rules.
> 2. Business rules change. Constraints on data do not.
> 3. Constraints on data should be specified in XML Schemas.
> Business rules
> should not. Business rules should be specified in higher
> level application code.
A good start, but not perfect. In fact I'm not sure it's any more than
choosing to classify those constraints which might change on a manager's
whim as "business rules", and those which are likely to be more stable as
"constraints on data". In other words, it's all about guessing which parts
of the requirements are stable and which aren't.
Given a rule like "two employees cannot have the same personnel number",
your guess is as good as mine how long that rule will be true. (Perhaps only
until the next merger...).
Also, there's no harm in using XML Schema to check data against the business
rules, so long as you realize this is *an* XML Schema, not *the* XML Schema.
We need to stop thinking that there can only be one schema.
Perhaps the most important thing is to distinguish between business rules
that really are rules, and those that are merely aspirations, like "every
employee has an annual appraisal".
> A company has employees. The current company policy on the
> minimum age
> requirement is 16. Should the company create an XML Schema
> that constrains
> <minimum-age> to 16? Or, should the company create an XML Schema that
> simply constrains <minimum-age> to an integer, and let
> applications higher
> up provide further constraints?
> - Mandating that the minimum age of an employee be 16 is a
> business rule.
> It is highly likely to change over time.
> - The value of the <minimum-age> must be an integer. This is
> a constraint
> on the data. It will not change over time.
> Therefore, an XML Schema should simply constrain
> <minimum-age> to be an
> integer. Higher level applications should implement the
> business rule that
> <minimum-age> be further constrained to 16.
> How would you characterize the distinction between "business
> rules" and
> "constraints on data"? /Roger
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>