I guess I would characterize Cocoon as an XML processing Engine. One of the things it can do is act as an MVC. We actually use the Cocoon portal to present web sites. It has been quite successful for us.

While your description of Cocoon being able to process an XSLT is certainly true, it is actually quite a bit more complicated than that. To illustrate, the Cocoon portal starts with an XML file that describes the pages and portlets in the portal. Each portlet definition can reference a Cocoon pipeline to generate its content. The portlet pipeline can generate XHTML or just XML. After all the portlets generate their content the result will be aggregated into a single XML document that can then be processed by transformers, which may or may not be XSLTs.

The point is that Cocoon allows you to dynamically generate your XML, dynamically choose how that XML is manipulated even so far as letting you dynamically generate your XSLT (why you'd want to do that is another question, but you could). For example, you could get a list of items from a database as XML and combine that with some XML configuration (which could be per user if you want). Your transformers would then be able to use the XML configuration when manipulating the list of items.

The advantage Cocoon has is that if your business logic can return XML then Cocoon can manipulate it into almost anything you'd like. This means that once you have a common agreement on the XML your web developers can create the view components to render the web pages from sample XML while the Engineers build out the business logic. If you don't want to go that far Cocoon does provide ways of accessing data directly.

On the other hand, things like Spring WebFlow or JSF do a much better job of capturing the logic flow of complicated applications. But JSF, WebFlow and Struts all allow their view handlers to be replaced in which case you could use Cocoon with any of them. In fact, Cocoon comes with a JSF block to demonstrate how this can be done. By default these frameworks use JSPs, but JSPs are acknowledged to have serious problems.

Does that help?

Ralph

Mansour wrote:
Thank you for your response.
Before I am going to use maven or look again into it, I need to know a bit about cocoon. I have used struts2, jsf, and it looks to me that cocoon is just another mvc frame work that uses xml heavily. I don't know if this right or wrong. It's advantage is that it can you can write an xslt and get the xml data to go through this xslt. You can put more than one xslt to process this data, with each one of them has a specific target, thus the SoC.
Am I wrong ?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to