I've been watching Groovy for a while, and share your feelings that it could be a very welcome addition to the Cocoon toolset.
...1-Allowing write Groovy code inside Cocoon....
The BSF already supports Groovy, and we have a BSF block (which I know little about), so something must be possible already.
And when you see the nice ways in which Groovy can generate XML or make SQL queries, it sounds like Groovy could play well with Cocoon, given the right interfaces.
...2-Groovy Flow Engine.
AFAIK, Groovy lacks of continuation support. This is the really main point
in a Flow Engine. But seeing that Groovy ends to Java bytecode, then maybe
the current new JavaFlow Block (thanks again to Stephen and Torsten) can
come to the rescue....
Yes, this is certainly possible.
I am seriously thinking in replace Java(Script) Flow Engine with a Groovy Flow Engine. It will be a great move....
Hmmm...technically I tend to agree but we must be careful to stay focused on one official tool for Flow and Forms. The last months have shown that clearly adopting one recommended way of doing things helps our users a lot.
Of course, having additional experimental stuff in parallel is great, but IMHO we shouldn't jump to conclusions until the technical proof is here.
OTOH I'm definitely convinced that the combination of
a) java b) a good scripting language c) powerful presentation tools
is killer for development today. Cocoon provides a) and c) but is IMHO a bit lacking or fragmented regarding b). Having the same scripting language everywhere (instead of javascript + XSP + others) would be a Good Thing in my opinion.
So, like you, I'm convinced that Groovy can play a very important role in Cocoon in the future. The first steps might be to write some examples in the bsf block, or write a Groovy block which is more tightly integrated, see [1]. I'm thinking (dreaming?) of Groovy-based Generators, Transformers and Serializers for example, I don't know if this is possible with the bsf block as it stands.
-Bertrand
[1] James Strachan's comment on Groovy and the BSF http://radio.weblogs.com/0112098/2004/01/23.html
