cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: tables logicsheet? (was App Design Philosophy Rant)
Date Fri, 16 Feb 2001 08:30:58 GMT
On Thu, 15 Feb 2001, Allan Erskine wrote:

> > depends on how you use esql. i write my own logicsheets which use esql in
> > turn, for instance:
> >
> > <xsl:template match="wzi:get-contacts">
> >   <esql:execute-query>
> >     <esql:query>select id,name,phone,email from contacts where client_id =
> > <wzi:get-contacts> wherever i want to in my xml pages.
> This looks like a very handy technique indeed....  What do you think the
> merits/problems would be with trying to generalise this approach...

the merits are that you get at least some level of implementation
independence. all that appears on your page is an element called
get-contacts. the element name is descriptive, more information can be
added using attributes or child elements, and the logic behind the
generation of the data can be changed at any time with no changes
necessary on the data pages. the drawback is that it resolving nested
configuration parameters can be tricky, especially for newbies.

> try to write a logicsheet that allows things like
> <tables:define name="contact">
>     <rowspace>
>         <col>id</col>
>         <col>name</col>
>         <col>phone</col>
>         <col>email</col>
>     </rowspace>
>     <implementation type="sql" src="resource:/postgres-table-mapping.xsd">
>         <rowspace-mapping>
>             <map from="id" to="ID">
>             ...
>         </rowspace-mapping>
>     </implementation>
> </tables:define>
> Then users could add <tables:get-table name="contact"/> tags throughout
> their code, with the possible advantage of knowing the tables are being
> generated in a consistent way.  You can imagine corresponding form or
> validator logicsheets that could construct say form instances based on
> tables.

i think you would enjoy checking out the castor project
( personally, i find this way of structuring a
sql to xml mapping to be difficult, plus it sort of simply treats the sql
database as a simple storage mechanism, which doesn't exploit the power of
SQL databases to sift through and combine large datasets with great
rapidity. i'm more interested in future evolution of things like xql.
we're making do pretty well with a mix of sql and xpath queries right now,
but within a few years i expect that to have changed.

> A possible disadvantage may be the difficulty in building in enough
> flexibility into the tables logicsheet.
> I'd be very interested in hearing what anyone thought of this, as I was
> seriously thinking of giving this approach a whirl...

it would be interesting to see what you come up with if you decided to
play around with this.

- donald

View raw message