Cocoon Flow + Java
Reinhard Pötz noticed this page about using Java (Not Javascript!!) in Cocoon for Flow control. (via Oividiu’s Blog). Interesting. I wonder how heavier this will be over the Javascript implementation.
Although…
Looking at the “guess the number” example, there’s quite a bit more code in the Java version versus my Javascript version that I did for the Wiki.
Code like this:
number = Integer.parseInt(ObjectModelHelper.getRequest(environment.getObjectModel()).getParameter(”number”));
Can be written like this in Javascript:
var guess = parseInt( cocoon.request.get(”guess”) );
Yes, please.
Questions:
How much heavier is the Java version over the Javascript version?
Are the Java continuations handled with the ContinuationsManager?
How long until we get Python to define Flow control? IMO the ultimate would be Python Flow control. I’ve seen stuff about stackless Python, and I’ve read messages asking the Jython people about a stackless version. They said it was impossible, but somehow I doubt that. I think they’re just lazy.
I think I’ll stick with Javascript for Flow control, if only to keep the # of lines down to a minimum. Simplicity is good. So is the interpretation.
Sylvain also weighs in on Java Flow Control.