myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cagatay Civici" <>
Subject Re: Scanning for annotated classes in MyFaces 2
Date Tue, 06 Jan 2009 21:03:28 GMT
I think we should avoid scannotation, not that it's bad but because it's a

MyFaces already has more dependencies compared to mojarra afaik and
increasing those doesn't sound good.

Classpath scanning is a tricky business and it's good both performance and
computing wise to limit the scanned packages like spring
does(scan="com.myproject.*") but I dont think this kind of behavior is in
the 2.0 spec.

On Tue, Jan 6, 2009 at 8:47 PM, Simon Lessard <>wrote:

> Hi Jan-Kees,
> I think it's ok for Apache projects to depend on external libraries that
> are not licensed under ASL 2.0. However that would be some extra
> dependencies for MyFaces and we try to minimize those. On the other hand the
> gain might worth it in this case imho if those libraries are deployed in
> common public Maven repositories.
> Thank for your help with MyFaces 2.0
> ~ Simon
> On Tue, Jan 6, 2009 at 3:32 PM, Jan-Kees van Andel <
>> wrote:
>> Hi,
>> The JSF 2.0 spec requires an implementation to support several
>> annotations, like @ManagedBean.
>> Has anyone already thought of a possible implementation for this
>> requirement?
>> IMHO, there is only one option, and that is scanning the classpath at
>> application startup, because you don't want the overhead with every EL
>> expression.
>> But there are some issues with this:
>> First, what paths to scan? AFAIK the spec doesn't state the classpaths
>> to scan. I suppose only /WEB-INF/lib and /WEB-INF/classes need to be
>> checked, but I can't find it in the spec.
>> And second, how to scan? Reading each *.class file, then creating a
>> Class instance and then using reflection to scan for annotations is
>> probably very expensive. Not only the processing time, but I think it
>> will also become a memory issue because every class in the classpath
>> will be loaded into memory.
>> Scanning the plain *.class files is probably not very practical. I
>> don't know, never tried it, but the class files I've seen don't look
>> very appealing. :-)
>> It might be an idea to look at Scannotation, which is an open source
>> library for scanning jar files for annotations. It works quite good
>> and it has the advantage of being very efficient because it doesn't
>> use the default Class/Reflection mechanism.
>> The project homepage says it has an Apache 2.0 license, but at the
>> same time it has a dependency on Javassist (licensed LGPL or MPL) and
>> the source files don't contain any headers, so it may be not an
>> option. I don't know, IANAL.
>> I was playing around with a @ManagedBean annotation parser, but It may
>> be a good idea to have a discussion on this subject since it probably
>> has some impact.
>> What do you think?
>> Regards,
>> Jan-Kees

View raw message