permaculture playing cards*
The moose likes XML and Related Technologies and the fly likes Cocoon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Cocoon" Watch "Cocoon" New topic
Author

Cocoon

Marco Yeung
Greenhorn

Joined: Sep 21, 2001
Posts: 5
Deal All,
Do you know in the internet is there any intensive tutorials for the usage of Cocoon from apache?

thanks
Marco
[This message has been edited by Marco Yeung (edited September 24, 2001).]
Caroline Iux
Ranch Hand

Joined: May 14, 2001
Posts: 103
Has anybody completed a project using Cocoon? I am curious. I have a basic understanding about Cocoon and played around with it for a while. My question is I feel like Cocoon alone is not enough to build an application or I should say it's not easy to build an application with only Cocoon. When diplaying a page, I feel xsl tags are not enough(I am not a guru in XSL, so it might be just me not knowing stuff) for dynamic processing. Also, what about forms and form validations? Is Cocoon easy enough to use to display messages for validation errors?
Thanks.
Skip Cole
Ranch Hand

Joined: Jan 05, 2001
Posts: 175
Hi,
I am very interested to learn the answer to the questions also.
1.) Has anyone ever completed a project with coccoon?
2.) What lessons were learned or experience can you share with us?
3.) Is cocoon slow?
3a.) How does it hold up under load?

Thanks!
Skip
[ September 09, 2002: Message edited by: Skip Cole ]

If you love me, you will visit docs.opensimplatform.org
(FYI, Getting it tattooed on is a bit much.)
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782

1.) Has anyone ever completed a project with coccoon?

Yes!! A few of our applications in production runs on Cocoon.

2.) What lessons were learned or experience can you share with us?

Everything here applies to version(s) prior to 2.0.
  • Do not use Cocoon for static transformations.
  • Hard to put in a custom front controller in front of Cocoon, unless it is a subclass of Cocoon's main servlet. This will greatly limit your options if your design requires that you have your own front controller.
  • You will do better to go with Xerces if you are using Cocoon. We've had some configuration issues while trying to use other parsers and abstract using JAXP. Same is true for Xalan.
  • For dynamic content generation, using plug-ion producers is the right way to go. It rocks!
  • Apache has redesigned the whole thing in Cocoon 2.0. It is so much different than the previous versions, we won't be able to "migrate" to the next version. We'll have to rewrite most of our stuff. That's bad.
  • With the producer architecture, it is hard to implement a true MVC pattern using Cocoon. If you even try, you will end up in way too many layers.


  • 3.) Is cocoon slow?
    3a.) How does it hold up under load?
    Depends on your design. If you use Cocoon even for static transformations, it will certainly slowdown the system. We use a "XML publishing" pattern for static XML files. It simply means we use plain XSLT to do offline transformations and store the output files in a separate directory. These transformed files are served to the clients directly.
    If you are using producers it will appear slow since you will have to build the XML from scratch and transform it. Although we have not officially benchmarked the performance, it is as slow( or as fast) as any other XSLT engine.
    Bottom line is that you should not think of Cocoon unless you are generating XML files on the fly and you may have to choose from a bunch of XSL files to do the transformation. Cocoon is just an intelligent layer over plain vanilla XSLT engine. One option you must consider before moving to Cocoon is whether or not you can do what you need to do using plain serverside programmatic transformations( Xalan, Crimson etc. ). If you are able to do this, then do a proof-of-concept and try to compare the efforts vs. results between the approach using Cocoon against the one that does not use Cocoon. Then make the decision.

    Hope that helps.
    [ September 11, 2002: Message edited by: Ajith Kallambella ]

    Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
    Balaji Loganathan
    author and deputy
    Bartender

    Joined: Jul 13, 2001
    Posts: 3150
    Originally posted by Ajith Kallambella:
    Hope that helps.
    quote:
    3.) Is cocoon slow?
    3a.) How does it hold up under load?
    Depends on your design. If you use Cocoon even for static transformations, it will certainly slowdown the system. We use a "XML publishing" pattern for static XML files. It simply means we use plain XSLT to do offline transformations and store the output files in a separate directory. These transformed files are served to the clients directly.
    [ September 11, 2002: Message edited by: Ajith Kallambella ]

    You are lucky Ajith,in our case,we have to generate the HTML and PDF on demand for a given XML,so its terribly slow,so i created a beautiful loading screen(wait screen) to distract user attention.we are using xalan,xerces,fop.
    Regards
    Balaji


    Spritle Software Blogs
    Ajith Kallambella
    Sheriff

    Joined: Mar 17, 2000
    Posts: 5782
    Lucky, not really. Read my statement again.

    [b]
    We use a "XML publishing" pattern for static XML files
    [b]

    It works only for static XML files. Most of our UI has dynamically generated content, only about 10% is static.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Cocoon
     
    Similar Threads
    Aligning component from Right to Left
    Cocoon and document() function
    Generating PDFs
    SCJD and Patterns
    list of excellent links?