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

Re: How you interpret your business rules has a profoundimpact

  • From: Stephen D Green <stephengreenubl@gmail.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Fri, 25 Mar 2011 07:33:20 +0000

Re:  How you interpret your business rules has a profoundimpact
Deciding which is the target/context of the assertion is similar, yes,
to deciding which is to be considered invalid. In this case, though,
you would have to admit that that decision is completely arbitrary.
What you have shown is that there are some categories of assertions
where the target/context is arbitrary. It's similar to saying that, in
grammatical terms

Fred is younger than Bob = Bob is older than Fred

However, which of the above two statements/assertions is chosen
will depend on other factors. It depends on the 'use case'/'scenario'.
It most likely depends on whether youth is the emphasis or agedness.
If I'm making the assertion in a scenario where youth is the emphasis
such as a discussion about who is the youngest then I'd use the first
but it would still be OK / valid to use the second.

----
Stephen D Green



On 24 March 2011 22:25, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Folks,
>
> Consider this book store document:
>
> <?xml version="1.0"?>
> <BookStore storename="BarnesAndNoble">
>        <Book>
>                <Title>Don't Make Me Think</Title>
>                <Author>Steve Krug</Author>
>                <Date>2006</Date>
>                <ISBN>0-321-34475-8</ISBN>
>                <Publisher>New Riders</Publisher>
>        </Book>
>        ...
> </BookStore>
>
> The document is used by a community that has this business rule:
>
> -------------------------------------------------
> Business Rule
>
>    The value of Publisher depends on the store:
>
>       If the store is BarnesAndNoble then
>       Publisher can be either Wrox Press or
>       New Riders
>
>       If the store is Borders then Publisher can
>       be either Norton Press or friendsofed
> -------------------------------------------------
>
> Given that business rule, this is invalid (because 'friendsofed' is an invalid publisher for the store 'BarnesAndNoble'):
>
> <?xml version="1.0"?>
> <BookStore storename="BarnesAndNoble">
>        <Book>
>                <Title>Don't Make Me Think</Title>
>                <Author>Steve Krug</Author>
>                <Date>2006</Date>
>                <ISBN>0-321-34475-8</ISBN>
>                <Publisher>friendsofed</Publisher>
>        </Book>
> </BookStore>
>
>
> What is invalid?
>
>  - Is BookStore invalid?
>  - Or, is Publisher invalid?
>
> Is the business rule a statement about what are valid BookStores? Or, is the business rule a statement about what are valid values of Publisher given its context?
>
> The question is important. It's answer has a profound impact on XML design.
>
>
> IMPACT ON XML DESIGN
>
> If the business rule is a statement about what are valid BookStores then, when you design your XML Schema, you should position an <assert> element on the BookStore element declaration:
>
>   Assert: Book/Publisher = ('Wrox Press', 'New Riders')
>
> If the business rule is a statement about what are valid values of Publisher given its context then, when you design your XML Schema, you should position <alternative> elements in the Publisher element declaration:
>
>   Alternative: if @storename='BarnesAndNoble' then text() = ('Wrox Press', 'New Riders')
>   Alternative: if @storename='Borders' then text() = ('Norton Press', 'friendsofed')
>
> and you should declare the storename attribute to be "inheritable".
>
> You must specify the store name in an attribute value and not in an element name. The following XML design would make it impossible to implement the business rule:
>
> <?xml version="1.0"?>
> <BarnesAndNoble>
>        <Book>
>                <Title>Don't Make Me Think</Title>
>                <Author>Steve Krug</Author>
>                <Date>2006</Date>
>                <ISBN>0-321-34475-8</ISBN>
>                <Publisher>New Riders</Publisher>
>        </Book>
> </BarnesAndNoble>
>
>
> QUESTION
>
> Is the business rule a statement about what are valid BookStores or is it a statement about what are valid values of Publisher given its context?
>
> /Roger
>
> _______________________________________________________________________
>
> 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.