Sir, Have you looked at Torque, which is an Apache Software Foundation project. Torque maps objects to relational databases. Torque provides all the set/gets to access table fields.
In Cocoon, you would write an action that would call the appropriate Torque classes to perform the database access. This keeps logic separated from the presentation - an absolute must. Ray > -----Original Message----- > From: Robert Sösemann [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 18, 2002 6:22 AM > To: [EMAIL PROTECTED] > Subject: XSP/ESQL - separation of concerns? > > > Hello, > > in my current project I am using xsp and esql logicsheet for db > retrivieval > and tag generation only. > Although I know that this is good for developing (no extra > compilation) I am > not very happy with it. > > What I don't like is: > ------------------- > - many SQL statement (complex tag structure) mixed cionfusingly with the > actual document elements > - the low readability of the code, also hard to debug... > - no "cocoon-like" separtion of concerns (mix SQL-logic with tags) > - the feeling that it is not the most performant way of doing this > > What I would like better (but don't excately know how): > ------------------------------------------------------- > - put all SQL that is needed for generating on specific page into another > "thing" (beans?) that has no tags > - make my xsp shorter, more readable > - have the good balance of performance, easy debugging, extensibility and > the typical "cocoon separation of concerns" > > Here is a short but typical code snippet: > --------------------------------------- > <ROOT> > <esql:connection> > <esql:pool>mysql_pool</esql:pool> > > <esql:execute-query> > <esql:query> > *COMPLEX QUERY, SOMETIMES 5 <esql:query> PER XSP * > </esql:query> > > <esql:results> > <esql:row-results> > <ARTICLE> > <xsp:attribute name="ID"><esql:get-int > column="5"/></xsp:attribute> > <xsp:attribute name="MAIN"><esql:get-string > column="7"/></xsp:attribute> > <xsp:attribute name="SUB"><esql:get-string > column="8"/></xsp:attribute> > <xsp:attribute name="PDFPRINT"><esql:get-int > column="9"/></xsp:attribute> > > <!-- Attribute evtl. NULL bei > Direktanzeige --> > <xsp:logic> > if(!<esql:is-null column="3"/>) { > <HEADER><esql:get-string > column="1"/></HEADER> > } > > </xsp:logic> > > <esql:get-xml column="2"/> > > <DATE><esql:get-string column="11"/></DATE> > <AUTHOR><esql:get-string > column="12"/></AUTHOR> > </ARTICLE> > </esql:row-results> > </esql:results> > <esql:no-results></esql:no-results> > <esql:error-results></esql:error-results> > </esql:execute-query> > </esql:connection> > </ROOT> > > </xsp:page> > > > Should I better use own generators or beans? What are your experiences? > > Robert > > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > > --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>