cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Introducing IOC for Java classes created in flowscript
Date Fri, 21 Nov 2003 10:31:29 GMT
Michael Hartle wrote:

> Sylvain Wallez wrote:

<snip/>

>>> If I understood Bertrands hint towards BeanShell right, it would 
>>> allow the people who are affraid of writing "real" Java code to 
>>> script an object which is then used in the flowscript we have today 
>>> - not replacing the current continuation language, but easing the 
>>> transition for scripters towards Java for objects to be called from 
>>> the flowscript.
>>
>>
>> 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.
>
> 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("myScriptedBusinessLogic.bs");
>>  cocoon.setupObject(foo);
>>  foo.doIt("blah"); 
>
>
> showing the example in conjunction with your proposed extension to 
> honour lifecycle interfaces. Or putting it the other way around, the 
> previously shown
>
>>  var foo = new Foo();
>>  cocoon.setupObject(foo);
>>  foo.doIt("blah"); 
>
>
> Foo class written in Java certainly does not have any 
> continuation-related extension - nor would the BeanShell-resulting 
> object need it, or ?


Ok, I understand the point. I've been thinking long ago about a 
"CompilingClassLoader", i.e a classloader to which we don't give .class 
files, but .java files and that compiles them on the fly and recompiles 
them automatically when needed. BeanShell may provide something similar 
without needing to write this complex classloader.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Mime
View raw message