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

RE: Separate data from rules ... is the XML Schema 1.1 <assert

  • From: "Jim Tivy" <jimt@bluestream.com>
  • To: "'Andrew Welch'" <andrew.j.welch@gmail.com>,"'Michael Kay'" <mike@s...>
  • Date: Thu, 18 Jun 2009 09:12:33 -0700

RE:  Separate data from rules ... is the XML Schema 1.1 <assert
Regarding where to put the checking:

1. User Experience is always better if you let the user know immediately
when they have broken a rule.  So this requires a check to the rules engine
and then a properly crafted User Experience response - like a good message
and perhaps a pointer to some help.  All this can be localized.

2. Your business logic level should reject invalid where your Business logic
API does not explicitly enforce rules.

3. The database can have "structural" rules but the error messages may leave
something to be desired and may not be localizable.

-----Original Message-----
From: Andrew Welch [mailto:andrew.j.welch@gmail.com] 
Sent: Wednesday, June 17, 2009 6:13 AM
To: Michael Kay
Cc: Costello, Roger L.; xml-dev@lists.xml.org
Subject: Re:  Separate data from rules ... is the XML Schema 1.1
<assert> element a step backwards?

>> 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/

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php





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


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.