[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: integration with the Papaki annotation indexer/repositor

alesj do-not-reply at jboss.com
Thu Oct 29 10:48:01 EDT 2009


"david.lloyd at jboss.com" wrote : 
  | I come to the opposite conclusion.  The ideal indexer will, in my opinion, scan a set of classes associated with an archive once (at run time), and maintain a completely string-based index of annotations -> members (by name), and classes -> superclasses (by name).  With this information, and one index per archive, you can find any annotation (including inherited) on any member of any class without loading the class or using reflection in any way.  If you were to use an optimized string map like a trie for example, it's possible this data could be collected very quickly and stored in much less space than the equivalent reflective solution.
  | 
This is one way of doing it.

But the fact is that you'll end up loading most of the stuff anyway,
so I don't see too much value with this approach vs. lazy reflective approach.

"david.lloyd at jboss.com" wrote : 
  | In addition, it's possible that this preindexing can be used to accelerate classloading, at least to the extent that missing classes can be identified without querying the filesystem.
  | 
I wouldn't mix the two of them.
CL is complex enough w/o this. ;-)

"david.lloyd at jboss.com" wrote : 
  | Finally, using this system one can reuse the same index even when the same class or JAR is part of many classloaders, since the index is based only on the file structure and not on what's been loaded (think of shared JARs in the classpath of more than one isolated EAR, for example).
  | 
I don't see how or why this helps?
The actual info will always be minimal - first loaded class / ctclass.
The rest is to mimic ann-repo according to CL hierarchy, which is where this reuse comes in play.

"david.lloyd at jboss.com" wrote : 
  | One of the driving forces behind the discussion was the need (in EJB3, IIRC) to be able to perform this kind of scanning without loading classes at all, even in the presence of inheritance across modules.  And this is a case where the existing solutions completely fail to meet the requirements.
  | 
Why or where did you pick up this fact?
If we do scanning with Javassist based Reflect, we don't load anything until it's absolutely necessary.

"david.lloyd at jboss.com" wrote : 
  | This is in addition to the use case of pre-indexing; but once such a fast/efficient index exists for online scanning, why not reuse it for offline scanning too?
  | 
That's exactly what we're doing.
Did you even bother to look at the project(s)?

"david.lloyd at jboss.com" wrote : 
  | And this, as one might say, is why reusing existing libs is bad. :-)  At least, using existing libs even when they don't quite meet the requirements.
  | 
Again, which missing requirements are we talking about here?

As much as I appreciate you pushing the ideas, arguments, ...
it still seems to me that you're arguing here with very little known facts,
which means you're consequently wasting my and others time.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262986#4262986

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262986



More information about the jboss-dev-forums mailing list