Specifying all biz rules in relational data
Date: Fri, 10 Sep 2004 13:45:58 -0400
Message-ID: <n8pshc.lvb.ln_at_mercury.downsfam.net>
My own experience and inclination has always propelled me towards code generators and database generators, leading to my current project, which is a complete application generator.
One of the philosophical cornerstones of all such projects is that the application can be specified entirely in some defined format. In my case the DD is itself a set of normalized tables (though for reasons not discussed here its persistent storage is not necessarily in a DB Server product).
The practical use of the idea is simple. Out of the DD, via the generator, are the three things that must be synchronized:
->  The docs
->  The app code (for me, that's pure UI, no biz rules)
->  The db (all tables, constraints, triggers, views, etc.)
There are other tricks too, most notably that an upgrade is the same thing as a fresh install. The generator is actually a differences engine, comparing existing DB structures to specifications, and adding/changing/dropping as needed. This means there is no separate code for an upgrade versus a new install.
The universal objection to such systems seems to be that they are crippled by whatever the author has chosen to support in the DD/generator. Underlying this objection is Godel's False Bastard Theorem of Software Development: "Given any set of tools for using relational data, there exists a situation that can be modeled with relational data but cannot be implemented with those tools." In the realm of data modeling, it seems that we can break that assumption with brute force.
To illustrate this, I would have to go back to the first use of the word "normalization" that I heard, which had nothing to do with databases, but was in an undergraduate Physics class. The professor was explaining that a set of promising theoretical equations could not be used because they contained infinities. The hero of the story was a physicist who "normalized" the equations by demonstrating how to remove the infinities so that they modelled reality. It has always been a private joke of mine that I have "normalized" databases by removing the "infinities" claimed by programmers who swear up and down that their situation is absolutely unique and cannot be solved by conventional techniques.
Then of course we have the work of Mr. Celko, that gives us a large set of solutions to known problems. The problem for those who have read the literature becomes learning to recognize the problem types. Is it going too far to say that if we could learn to recognize the problem types, then we could reliably model anything by either:
-> Recognizing a simple problem as a recognized type, or
-> Casting an apparently "unique" problem into a form that is recognized.
In other words, the claim is that there are no unknown problems, only unrecognized forms. If this is true, then it follows that a finite set of tools in a DD/generator could generate a solution for any problem that can be modeled in relational data.
Just curious as to what people think.
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Fri Sep 10 2004 - 19:45:58 CEST
