[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SV: [xml-dev] When to Validate XML?
- From: "Jens Jakob Andersen, PDI" <firstname.lastname@example.org>
- To: email@example.com,"Champion, Mike" <Mike.Champion@SoftwareAG-USA.com>, firstname.lastname@example.org
- Date: Tue, 06 Nov 2001 16:56:41 +0100
> 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
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
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