Apache Cocoon 3 on the way

Now it’s official: Corona, the reimplementation of Cocoon which is currently available in the Cocoon whiteboard has been accepted by the Cocoon PMC and will become Apache Cocoon 3, the next major version of Cocoon!

When Steven and I started with the reimplementation, we had two main goals:

  1. Have a clean and simple Java Pipeline API that isn’t bound to any particular content (SAX, StAX etc).
  2. Make Cocoon 3 a great fundament for RESTful webservices.

These goals are more focused than the goals of Cocoon 2 because, as Stefano pointed out in [RT] Is Cocoon Obsolete, things have changed a lot and web applications are developed very differently than 10 or even 3 years ago:

  • RubyOnRails has taught us that simple things should become simple again and many things in the Java world feel like Cargo Cult programming.
  • There are many high quality libraries that make Javascript development for web browsers so much simpler.
  • Apart from Flash, using the Mozilla platform directly, the heavy Java applets or the propriatory ActiveX components, other alternatives like Silverlight and JavaFX become available.
  • Apache Wicket successfully applies object-oriented sotware development principles on web applications.
  • Many web applications are mash-ups of many internally and externally available web services (Google Maps, Flickr, YouTube etc.)

Cocoon 3 has been optimized to live in such a changed world:

  • It focuses on providing RESTful webservices. For rich client technologies (including plain Javascript clients) they are the ideal contract for the client-server communication. Following this path also gives you a clean API for your web applications for free, that can be used by machines as well.
  • Cocoon 3 doesn’t provide a stateful forms framework. Nowadays, you either develop a rich browser client or you use a really advanced server-side frameworks like Apache Wicket or GWT which hide a lot of the complexity that comes with web applications.
    This polarization will make many established web frameworks like JSF, Struts, Spring WebFlow becoming obsolete if they don’t decide for one of the two paths.
  • XML, XHTML and HTML5 are (still) important technologies in the development of web applications. Cocoon 3 that provides some default implementations of SAX-based components, still has a strong point when it comes to the generation, transformation and serialization of XML.
  • Cocoon 3 has a layered architecture: The fundament is a pipeline module that doesn’t have any dependencies except Java 5 and Apache Commons Logging. On top of it there is a sitemap language interpreter. The current implementation uses Spring 2.5 but this dependency is hidden behind an interface and the implementation is only one! class. This means that you can easily integrate the pipeline and/or the sitemap module into your own Java application.
    As you might have noticed, there is no dependency on the Java Servlet API so far. If you want to run Cocoon 3 as web application, there is a third module that provides a servlet for that purpose.

The website of Cocoon 3 is online and the first alpha release of Cocoon 3 is at the ready. Stay tuned! (For those of you who don’t want to wait, read the build instructions.)