Re: [hibernate-dev] Accessing annotation properties values

2012-10-05 Thread Emmanuel Bernard
Because the set of annotations is well defined, I won't if you could use an actual real implementation instead of a proxy. That's mor work but this will be much faster as we would not need to build the proxy. Alternatively, I wonder if we could cache the serialized proxy somewhere or even build

Re: [hibernate-dev] Accessing annotation properties values

2012-10-05 Thread Sanne Grinovero
I have no clue on the performance impact in practice, but I'd be careful in that area. Generally I'd not discard the idea of slightly more complex code if it avoids some more proxies and save some memory, but I don't know the details here. Typesafety doesn't look like a strong argument to me as an

Re: [hibernate-dev] Accessing annotation properties values

2012-10-05 Thread Steve Ebersole
I can only speak from what I have seen in the core code. And yes, there I have often seen lookup for the same annotation multiple times. Is that worth caching? I'd have to think so. Creating javassist proxies is not cheap. On Fri 05 Oct 2012 03:59:45 AM CDT, Hardy Ferentschik wrote: > > On

Re: [hibernate-dev] Accessing annotation properties values

2012-10-05 Thread Hardy Ferentschik
On 5 Jan 2012, at 4:05 AM, Steve Ebersole wrote: > Probably you can cache it by AnnotationInstance, so maybe something > like this instead: > > class AnnotationProxyBuilder { >private final Map annotationProxyMap = new ...; > >public T getAnnotationProxy(final AnnotationInstance > an

Re: [hibernate-dev] Accessing annotation properties values

2012-10-04 Thread Steve Ebersole
Probably you can cache it by AnnotationInstance, so maybe something like this instead: class AnnotationProxyBuilder { private final Map annotationProxyMap = new ...; public T getAnnotationProxy(final AnnotationInstance annotationInstance, final Class annotationClass) { T annota

[hibernate-dev] Accessing annotation properties values

2012-10-04 Thread Ɓukasz Antoniak
Hello Team, In Envers code we use ReflactionManager and XProperty#getAnnotation(Class) quite often. While working on metamodel branch, I have started replacing all those calls with JandexHelper#getValue(AnnotationInstance, String, Class) method. The code became less type safe and grew in size