On Wed, 15 Nov 2000, Andy Wardley wrote:

> In particular, I think it should be possible to create a generic template
> based system for creating select/delete/insert/update views from an
> underlying schema.  This would include database tables, XML DTD's, etc.

(Uhhh, hi everyone. I'm new here.)

I have done this at length, it is indeed a very good idea and the product
is very smooth indeed. </own_trumpet> The principle is to define the data
structures, then the atomic operations which are possible on the data in
terms of the structure of the data. e.g. an update operation on an object
which has a foreign reference constraint on one of the fields must
automatically maintain that constraint.

Having got the structures and operations configured, it is just a matter
of invoking the atomic operations from whatever front end you choose. I
use HTML::Mason, the average page has one or two lines of 'real Perl' and
a lot of <% $ob->get('field') %> in it. There are no output calls anywhere
in the atomic operations, and there is no processing in the pages.

The system allows creation of more complex operations by blessing methods
into the appropriate classes and adding them to the actions hash. The data
structures form an object relational data management system, currently
running off DBI and MySQL, but in fact there are only three (IIRC) MySQL
specific lines in the project.

Development cycles for simple applications (BBS, mailman-like server,
shopping basket app, etc) are down to a couple of hours. In fact, the
specifications are still anonymous Perl hashes, because it isn't
commercially effective for me to write an XML parser this week (although
admittedly trivial). I'll do that after first beta.

The system currently runs in mod_perl, although the data management
section is independent of mod_perl and the modules can be used in a
standalone application. This is a feature of the isolation of the output
mechanism from the definitions of the data structures and operations.

Unfortunately it is still living in the professional workplace, I have
probably a 50% chance of convincing them to release it under the Perl
license in the next month or two. I'm hoping that other people would be
interested in continuing the development of such a project.

Mind you, if they don't, I'll go home, write a whole load all over again 
on my time, and release it. I can virtually recite the code for this, and
can explain the design decisions and problems we came across.

S.

--
Shevek
What goes up must come down. Ask any systems administrator.

Reply via email to