You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Miloslaw Smyk <th...@amiga.com.pl> on 2000/09/10 02:38:38 UTC

Design of web apps based on Cocoon

Hello,

In a few weeks I'll start a project to create a middle-sized website with a
team of two programmers. Because the website has to be accessible in
WAP/text/whatever formats and its business logic seems to be not really
_that_ complicated, I planned to give Cocoon a try.

I played with examples and tried recreating some of the things I've been
doing with PHP3. So far so good, although obviously the approach differs a
lot. I used a following path:

database --> ESQL --> XSP --> XSL --> result

My assumption was that I'd put any business logic I'd need into XSP (and
perhaps into clever SQL queries) and perform output formatting with XSL. It
worked for me, but then, I didn't try anything really complicated.

However, some of the recent emails here suggested that EJBs should be used
at the beginning of the above path, encapsulating SQL-queries and BL, while
XSP would be only used to select what actually gets passed to formatters.
Another suggestion was to avoid creating producers by hand.


My question is: could someone shed some light into overall design of
Cocoon-based apps? I mean, what's the preferred path to use, starting from
records in the database up to formatting stage, assuming that there is some
BL and some formatting?


Thank you in advance,
Milek
-- 
mailto:thorgal@amiga.com.pl   |  "Man in the Moon and other weird things" -
http://wfmh.org.pl/~thorgal/  |  see it at http://wfmh.org.pl/~thorgal/Moon/
         Fight for the good cause: http://www.laubzega.com/dvd/

Re: Design of web apps based on Cocoon

Posted by Alexander Weinmann <aw...@bct-technology.com>.
Hello,

I can only tell you about the experiences that I had working
with Cocoon:
In the beginning I worked the way you describe using the sql taglib
for database queries. For me, this turned out to be usefull only
for very simple cases.
As soon as you have to execute more than  one DB Query for the same
request, or if you have to do some more processing before or after the
query, your XSP pages tend to become very complicated. - Code
reusability
also becomes a problem.
The second  step ( using stylesheets) is also quite difficult, because
it is very difficult to define apropriate tags at the beginning of a 
project.
That's why i came to the conclusion:
Even for sites of medium complexity it is best to do a good object
oriented modelling and then use the resulting beans inside an
XSP page --> Use set methods to initialize the properties
of your bean with  http request parameters, and then use the getters
just to build up your dynamical XML Output.

PS.:
"Simple" is rare, "middle-sized" often turns out to be more 
complicated that expected (Reality is not "middle-sized", unfortunately)


Miloslaw Smyk wrote:
> 
> Hello,
> 
> In a few weeks I'll start a project to create a middle-sized website with a
> team of two programmers. Because the website has to be accessible in
> WAP/text/whatever formats and its business logic seems to be not really
> _that_ complicated, I planned to give Cocoon a try.
> 
> I played with examples and tried recreating some of the things I've been
> doing with PHP3. So far so good, although obviously the approach differs a
> lot. I used a following path:
> 
> database --> ESQL --> XSP --> XSL --> result
> 
> My assumption was that I'd put any business logic I'd need into XSP (and
> perhaps into clever SQL queries) and perform output formatting with XSL. It
> worked for me, but then, I didn't try anything really complicated.
> 
> However, some of the recent emails here suggested that EJBs should be used
> at the beginning of the above path, encapsulating SQL-queries and BL, while
> XSP would be only used to select what actually gets passed to formatters.
> Another suggestion was to avoid creating producers by hand.
> 
> My question is: could someone shed some light into overall design of
> Cocoon-based apps? I mean, what's the preferred path to use, starting from
> records in the database up to formatting stage, assuming that there is some
> BL and some formatting?
> 
> Thank you in advance,
> Milek
> --
> mailto:thorgal@amiga.com.pl   |  "Man in the Moon and other weird things" -
> http://wfmh.org.pl/~thorgal/  |  see it at http://wfmh.org.pl/~thorgal/Moon/
>          Fight for the good cause: http://www.laubzega.com/dvd/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- 
Alexander Weinmann | Web Developer
BCT Technology AG | D-77731 Willstätt/Germany | www.bct-technology.com
Phone +49(0)07852/996-0
Fax   +49(0)07852/996-100