cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Fagnani-Bell <>
Subject Starting a conversation: OO, CMS's, Zope, open source
Date Fri, 17 Oct 2003 21:49:31 GMT
Hello everyone,

   I have been working in Cocoon for a couple of years now and have 
built up my own web-app framework over time. It uses Cocoon, but like 
Cocoon in many ways replaces Servlets by handling all incoming 
requests, my web app in some ways replaces Cocoon by handling all 
requests into a single pipeline. It's based very much on OO principles 
and uses a SQL backend to store objects.

Here's the ting though; since I've created this in a vacuum, I don't 
know if it's good design or not. It's been a lot of work, and sometimes 
I feel like I might be wasting my time by not just doing things the 
standard cocoon way (I know there's many ways to do things in Cocoon, 
but I mean with XSPs, aggregators, multiple pipelines, etc). On the 
other hand it makes sense to me and feels right.

I'd like to start a discussion on design principles in web apps. Maybe 
someone will talk me out of the way I'm doing things. Maybe some people 
will like it. I've also been wondering if I should open source it or 

Here's the basic concepts:

The web application is based on an object tree. All objects have a 
name, and URLs point to a particular object, though the hierarchy of 
the tree. For example refers 
to the object named page1 that is a child of the object chapter2, 
etc... The closest I've seen another web app come to this is Zope.

The database has an objects table that stores the type and the name and 
links for building the object tree. it's basically just a hierarchical 
db built on a relational db. (I question this setup a lot, but I don't 
have any experience with OO databases). Each object in the database is 
represented by a java object, which is kind of like a lightweight 
Cocoon Generator and Action rolled into one. The java classes have a 
method to generate their XML representation and call that method on 
their children.

So the above URL, with real simple java implementations would generate 
XML that looks a little like this:

<section name="section1">
   <chapter name="chapter1">
     <page name="page1"/>

that's leaving a lot out, but it gives an idea that the XML is nested 
and represents the actual nesting of the objects. Objects can have 
attributes as well, and the IDs are printed too. This is the output of 
my generator. The transformers are the standard Cocoon ones, but I 
always use an XSLT transformer and have wired it so that an object can 
choose what stylesheet to use. There's all kinds of other stuff that 
makes it a usable system, objects can control what other objects are 
printed by including them, they can have actions, they can generate 
different xml based on extension, or a concept of a view.

The java classes are generated from xml files that are a lot like XSP. 
These files are sort of a combination of Model, View, and Controller. 
There's a schema section describing the attributes and content, there's 
a views section which is similar to XSP, and there's an actions section 
with is like a XSPAction. When you drop one of these files in the new 
type becomes available to the web-app editor. The editor is the 
graphical front end to the system where you can assemble the object 
tree and edit the object properties. I'm working on editing the styles 

Well, that's an overview. I have to think that other people, besides 
the Zope guys, have thought about or tried something like this, but I 
can't really find anything out there even though Java seems very well 
suited to this. That's why I wonder if my concept is flawed in some 
way. I've used it in some live sites, but small ones, so I don't know 
if it scales. I had performance issues at first, but implemented some 
caching that helped.

So if anyone has any comments or opinions on this stuff I'd love to 
hear it. I know there's a lot of CMS systems based on Cocoon already. 
Is there interest in another one?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message