On Thu, 29 Mar 2001, Steve Downey wrote:

> doing some static analysis, based on class use of other classes, it looks
> like this constellation of classes could easily be factored out into their
> own package:
> 
> org.apache.jasper.compiler.Compiler
> org.apache.jasper.compiler.Mangler
>       org.apache.jasper.compiler.CommandLineCompiler
>       org.apache.jasper.compiler.JspCompiler
> org.apache.jasper.compiler.JavaCompiler
>       org.apache.jasper.compiler.JikesJavaCompiler
>       org.apache.jasper.compiler.SunJavaCompiler
> org.apache.jasper.compiler.JspCompilationContext
>       org.apache.jasper.JspEngineContext
>       org.apache.jasper.CommandLineContext
>       org.apache.jasper.JasperEngineContext
> 
> Based on actual use, it looks to me like Mangler and Compiler should be
> merged. There are no instances of Compiler that do not implement the Mangler
> interface. 

I don't know - the Mangler has a very nice and clear role - generating
correct java package/class name out of some strings. It is quite generic,
and independent - I would rather move it in a util package (
i.e. independent of jasper ).

I also think that Compiler should _use_ Mangler instead of implementing
it ( that's also true for JspEngineContext, and probably few other cases).


The java compiler is a nice one ( since ant has a nice collection of
compilers ), this should definitely go in a util package and maybe someday
we could sync it with the ant javac ( which is far more powerfull IMHO ).
And of course we decouple ourself from the javac problems.



> The classes that implement JspCompilationContext look to me like they don't
> all belong in the same package, unless everything here is in the same
> package. They are interface classes between the Jasper compiler and the
> outside invoker of the compiler. 

+1

Probably they belong in the same package with the "adapter" ( JspC,
JspServlet, JspInterceptor, an eventual JspValve ). 

I would even split JspCompilationContext based on use ( i.e. find what is
used in the java Generator, in Parser, in compiler - simpler and more
specialized interfaces would help ).

Costin

Reply via email to