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

SV: When to Validate XML?

  • From: "Jens Jakob Andersen, PDI" <jens.jakob.andersen@p...>
  • To: michael.h.kay@n...,"Champion, Mike" <Mike.Champion@S...>, xml-dev@l...
  • Date: Tue, 06 Nov 2001 16:56:41 +0100

pl sql validate xml
Hi Mike

> Actually I think a lot of people use database-level 
> validation during normal
> running, and then duplicate most of the checks at application 
> level. The

Again, db level check is still just the syntax / structure.

When you need to do a Semantical check, you need to implement this in
the application.

An example is a CRM system I designed before coming to SAG, where we
used DB level checks (triggers and rules) a lot to ensure the
_integrety_ of the database, i.e. to ensure that the database wouldnt
corrupt. 

A very simple example: "You couldn't delete a customer if that customer
had open orders" (Dont ask me to show you the clean-up script that we
used during testing to clean the database, it was quite big, since it
had to cleanup everything, starting at the "edges" and ending with the
central tables, in order not to create integrety violations.)

So you could say, that the table structure itself, guarantees structural
validation on table level.
I.e. trying to insert ('Mike Kay', 'Software AG', 'XML',10) in the table
Emp[Name, Company] will generate a SQL error.

Triggers and rules guarantees relational integratiy, as well as "scope":
I.e. trying to insert ('Jens Jakob Andersen', 'Post Danmark', 'XML',10)
in the table  Emp[Name, Company, Speciality, Number_Of_Keynotes] will
generate a SQL error, if there is a rule for Emp.Keynote saying that all
numbers inserted here must be between 20 and 100.

So you can use RDBMS triggers and rules to handle a lot of those checks
that you otherwise would have to write in every application. Great. On
the other hand, there are application specific rules, that cannot be
implemented in the DB. (And yet, using e.g. Oracle and PL-SQL, you can
create some very nifty rules and triggers...)

I also agree a lot with the other statements, about using triggers and
rules in the DB is the only way to ensure integrety on the DB level,
which is especially important in e.g. a n-tier architecture, where the
DB is accessed from many different applications.

Hmmm. Any read the book "Business Component Factory" by Pter Herzum and
Oliver Sims? It touches some of these issues from a CBD viewpoint.

All the best

JJ



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-2011 All Rights Reserved.