cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: Introducing IOC for Java classes created in flowscript
Date Fri, 21 Nov 2003 10:30:42 GMT
Le Vendredi, 21 nov 2003, à 11:11 Europe/Zurich, Michael Hartle a écrit 

> Sylvain Wallez wrote:
>> ...And also the other way around: BeanShell would allow people who 
>> are reluctant to using server-side JS to use the familiar Java 
>> syntax. But once again, the first requirement is to have continuation 
>> support.
> I think there still some misunderstanding; BeanShell does not provide 
> continuations and is not suited for running as a flowscript language 
> like the Rhino JS (with its continuation support) does - here we 
> agree. But thats not the point of Bertrand, as beanShell can turn a 
> script into a Java object which in turn can be used in a typical, 
> today JS flowscript.

That's what I meant.

> ..Instead of an object of a Java class Foo being hardcoded (and 
> supposedly feared by hardcore scripters due to compilation/packaging 
> requirements), it would result into something along the lines of
>>  var foo = 
>> BeanShell.newObjectFromScript("");
>>  cocoon.setupObject(foo);
>>  foo.doIt("blah"); ...

Exactly: allowing BeanShell (or any BSF) scripts could be used not only 
for Generators and Actions (as the BSF block currently does), but for 
scriptable business logic (and why not transformers or serializers by 
the way).

In this context, BSF scripts do not need any continuation support, 
they're used as java objects would be.

Depending on how you look at it, it might open wide avenues or a can of 
worms ;-)

But being able to prototype business logic in interpreted java code 
would be a big plus IMHO.  Not to mention a great teaching tool.


View raw message