Written on May 6, 2005 by Ugo Cei
Rated: 5/5.
The
website
explains quite nicely what you can expect from Cocoon,doesn't it? The problem is
that, on the other hand, it does a lousy job of explaining in clear and
comprehensive terms how you are expected to work in order to reap all those
benefits.
As we all know, great documentation is not a selling point of many Open Source projects, and Cocoon is not different in this respect. Add to it the fact that it is a complex, evolving framework that sometimes gives you too many options when you have to implement something, and you'll begin to understand why the docs, to put it bluntly, largely suck.
Alas, all is not lost. You have a users' mailing list for you beginner's questions and a developers' mailing list where you can discuss Cocoon internals and more esoteric issues. You can expect to find a quick and detailed response on either. Even beginner-level requests for support are not shunned on the dev list, as is the case with some other projects I know of.
Other valuable resources are books (a bit outdated though) and articles that you can find online.
Also, if your pockets are deep enough, you can hire
very good
consultants
to hold your hand while you're dipping your toes in the water for the first
time.
To sum it up, don't be put off if at first you're having some difficulties. With a good knowledge of Java and XML, and maybe some external help, you can surpass them quickly.
Well, enough about lack of docs and on to the good stuff.
I started using Cocoon back in the days of version 1.7 (1999 circa) and never stopped. I have developed maybe twenty projects with it and done my small share of contributions, in the spirit of Open Source, that gained me committer status back in 2003, of which I'm very proud.
There are lots of gems in Cocoon, but I would like to draw your attention to a couple of them, in particular: Forms and Flowscript.
The Cocoon Forms framework is one of the more elegant toolkits for doing web-based forms that you can find. It embodies perfectly the Separation of Concerns philosophy of Cocoon, allowing one to separately define form model, definition and appearance.
Continuations-based Flowscript is something that will really revolutionize the way you develop web applications. Without it, implementing complex control flows for the web is a daunting task, forcing you to implement finite state machines and tricks like hidden form fields in order to overcome the inherent statelessness of HTTP. I cannot explain the concept of continuations in this review, but I can assure you that once you get the hang of it, you will never ever want to come back. For an in-depth look, I can refer you to a recent article on developerWorks.
The other great thing about Cocoon is not in the code. It's the community. You won't easily find a community of developers that is like Cocoon's. The best way to appreciate it is to participate in the annual GetTogether event.
Now for some less enthusiastic notes. What I like less about Cocoon is the fact that it's based on the Apache Avalon framework. Avalon was one of the first examples of a framework based on Inversion of Control, and was great for its time, but nowadays it looks quite dated if you compare it to something more modern and less invasive, like Spring or Hivemind.
Should you be worried about this? Not at all. First, you're not supposed to be an Avalon expert to use Cocoon. You can develop a wide range of applications without ever implementing a custom Avalon component. Personally, I like to develop applications by implementing all my business logic with Spring and persistence with Hibernate, using Cocoon's Flowscript to take care of, roughly, the controller part of the MVC triad, and Cocoon's generators, transformers and serializers to implement the view part.
In conclusion, I cannot give Cocoon less than five stars, given how much it has helped me in the latest years. It has its shortcomings, but who hasn't, and you can see them as part of its overall philosophy. There's a Cocoon Way of doing things, and you can bend it, but to a point.
Highly recommended.
