cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Question about the compileScript method in the JavaScriptInterpreter
Date Fri, 10 Oct 2003 13:02:51 GMT
Carsten Ziegeler wrote:

>The compileScript method in the JavaScriptInterpreter looks like this:
>>   public Script compileScript(Context cx,
>>                               Environment environment,
>>                               String fileName) throws Exception {
>>       Source src = environment.resolveURI(fileName);
>I'm wondering why here the environment is needed for resolving the source. A usual source
resolver should do the trick as well, no? If we would use the source resolver we could release
the source cleanly and we avoid the hacky dependency that the environment accidentally implements
source resolver as well.

Actually, the whole flow stuff abuses the use or Environment, when it 
simply needs the object model. On my todo list is some refactoring to 
remove all uses of environment in the flow, unless someone else 
volunteers for it.

In the meantime, we can simply replace uses of the Environment by the 
real SourceResolver where needed.

BTW, regarding the forthcoming refactoring of Environment: is this 
"accidental" implementation of SourceResolver really needed?


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -

View raw message