XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Implement data rules in application code?

I think, this is a useful topic of discussion. As far as I can think, data rules can be implemented in application layers. One layer is application code, and the layer above it is XML Schema (Schematron, XSD, RelaxNG etc).

This depends on the complexity of the application. For a complex application, with multiple stakeholders, data rules can be implemented simultaneously both in application code and the XML Schema. XSD has an xs:annotation element, where a user friendly description of the rule can be written. Of course, the XPath expression of the rule, can be complex to understand the underlying meaning of the data rule. But we need to use something like an xs:annotation, to simplify things for the user. 

On 10 April 2017 at 22:35, Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

Lately, to my surprise, I have been hearing more and more people advocate the use of application code to enforce data constraints (data rules). Particularly the complex data rules you might expect to find in Schematron. Their argument, presumably, is that for most domain experts and business people, data rules such as the following are gibberish:

<sch:pattern id="Knowledge-about-radio-stations">
   
<sch:rule context="GeographicArea">
       
<sch:let name="stations" value="RadioStation"/>
       
<sch:assert test="
            every $s1 in $stations, $s2 in $stations satisfies
                if (pred:Disjoint($s1, $s2)) then
                    number($s1/band) ne number($s2/band)
                else true()
            ">
            Radio stations broadcast on different frequency bands (within an area).
       
</sch:assert>
   
</sch:rule>
</sch:pattern>

 

Since they are gibberish, you might as well have the developers implement the rules in application code. Out of sight, out of mind.

 

I guess that’s their argument.

 

I thought the world had moved beyond such thinking, years ago. I thought that everyone had come to the agreement that burying data rules in application code is a bad idea.

 

So what happened?

 

Did the world suddenly get amnesia? Did the experience from the last 20 years reveal that expressing data rules in text, declaratively didn’t work out as desired?

 

/Roger

 




--
Regards,
Mukul Gandhi


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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS