Last week the vote for Cocoon 2.2-RC2 passed and I’m happy to announce the release of it. Actually Cocoon 2.2 isn’t the big monolith that you might know from the 2.1.x or 2.0.x series. We have been working hard to make Cocoon more modular:
From a first glance the most significant change has been that since version 2.2 Cocoon is based on the Spring 2 framework. We also introduced two new subprojects:
- the Cocoon Spring Configurator which provides consistent configurations and distributed bean definitions for web applications and
- the Cocoon Servlet-Service framework which introduces contracts between sub web applications.
Both can be easily used without Cocoon Core.
Cocoon Core has been put on top of those two frameworks and “only” provides pipelines, sitemaps, out-of-the-box caching support and the most important sitemap components. Everything that goes beyond that has been moved into its own block. Also custom Cocoon applications are build as blocks.
So what’s a block in Cocoon 2.2? You might be familiar with the term block from Cocoon 2.1. In 2.1 a block was a unit to modularize the build system. Starting with 2.2 a block has become more: A block has become the unit of modularization (Eclipse uses the term plugins, OSGi bundles) in Cocoon and can provide the following services:
- general servlet services (any servlet can be managed by the Cocoon servlet-service framework),
- special services that provide pipelines as services,
- component services (Spring beans, Avalon services/components),
- a container for classes and resources (e.g. sitemaps, templates, images, etc.).
A block is packaged as a Java archive (jar) following certain conventions concerning the directory structure. So adding a block to your Cocoon application only means adding it as a dependency and all the services (see above), Java classes and recourses become available automatically.
Are you curious? There are a bunch of tutorials that help you to get started!