Re: chooses not to generate code at all
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Mon, 22 Aug 2005 17:27:53 GMT
Responding to JXStern...
I belong to the camp that thinks nothing should be in stored procedures except rules related to data integrity that have the stability of Keplar's or Maxwell's Laws.
Do they have canoeing and archery at that camp?
I don't know how to turn that kind of statement into a decision process, since any rule that is true, is as true as Maxwell's Laws.
The issue is stability. Max's Laws haven't changed in quite awhile. However, most business rules and policies are not so stable. I don't think any rules or policies that are at risk for needing maintenance (or whose scope of application may change) should be implemented as stored procedures.
[At least in the conventional sense where the procedure is triggered by specific database updates. In theory one could store code, parametric data, and whatnot in the DBMS that is selectively invoked by external applications. In that case those applications define the scope and context of execution rather than the DBMS' data. So in that case the DBMS is just a storage medium for the procedures and doesn't decide when they should be executed.]
FWIW, I think SQL is an implementation of MDA principles because it enables a generic transformation from one model representation (application data) to another (RDB storage). In the end MDA is simply:
[Input Model] [Transformation Model] | | | | V | {Transformation} <----------+ | | V [Output Model]
If we have an Input Model of objects, C structs, FORTRAN arrays, or whatever for a specific application and we need to turn it into an RDB representation (schemas, tables, tuples), then SQL is one Transformation Model that formalizes that conversion. The actual Transformation can be done manually by the developer in the 3GL de jour or it can be automated by a full code generator.
Well, to start with, SQL is not the model, but relational algebra is, SQL is just one language that operates in that domain. And neither relational nor SQL prescribe any transformation from outside representations, though reduction to cannonical form is a common practice in and around relational, but its strength comes from the existence of the cannonical form, not from being a process.
In this context relational algebra provides a meta-meta-model. SQL is an instance of that model representing the meta-model for those computing environments where one chooses to employ SQLServer for application implementations. If one is generating code for a particular application, then the Transformation Model is an instance of the SQL meta-model that provides the specific mappings necessary for the application context (e.g., FORTRAN array name to enterprise RDB table name). If development is manual, the developer supplies that mapping directly in the 3GL code (i.e., the Transformation Model is in the developer's head).
But if we want to explore the idea that relational database is a sort of MDA, then we return to the previous question - is the part of relational technology that is formalized, which is just the tables and relations and not code in triggers or stored procedures, enough to even constitute a "model" in MDA terms? And I'm in the camp that thinks not. In this camp we also learn how to tie knots and find edible foods in the forest.
An RDB is not "an MDA". It is simply a model instance that can be either an Input Model or an Output model under MDA, depending upon context. It happens to instantiate a meta-model, which is reflected in schemas, etc.. That meta-model instantiates a general data model especially tailored to persistence (Table, Tuple, Field). That meta-model is, in turn, an instance of the more general relational set theory meta-meta-model.
I think the issue around the content of stored procedures has nothing to do with the various models or whether those models can be accommodated within the MDA transformation paradigm. The issue of content is more about maintainability and separation of concerns with respect to good software development practice. IOW: render unto Caesar the things that are Caesar's and render unto the DBMS the things that are data storage.
************* There is nothing wrong with me that could not be cured by a capful of Drano.
H. S. Lahman hsl@xxxxxxxxxxxxxxxxx Pathfinder Solutions -- Put MDA to Work http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman (888)OOA-PATH
.
- Follow-Ups:
- Re: chooses not to generate code at all
- From: JXStern
- Re: chooses not to generate code at all
- References:
- Re: chooses not to generate code at all
- From: H. S. Lahman
- Re: chooses not to generate code at all
- From: JXStern
- Re: chooses not to generate code at all
- From: H. S. Lahman
- Re: chooses not to generate code at all
- From: JXStern
- Re: chooses not to generate code at all
- Prev by Date: Re: XP and Pair Programming
- Next by Date: Re: Coding Standards: Response to Roger L. Cauvin
- Previous by thread: Re: chooses not to generate code at all
- Next by thread: Re: chooses not to generate code at all
- Index(es):
Relevant Pages
|