aspose file tools
The moose likes Java in General and the fly likes Annotations Inheritence Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Annotations Inheritence" Watch "Annotations Inheritence" New topic
Author

Annotations Inheritence

R van Vliet
Ranch Hand

Joined: Nov 10, 2007
Posts: 144
Hi,

We're running into a situation where annotation inheritence would help us out. This is currently not possible and we were wondering why this could be. Note we're talking about one annotation interface extending another, not inheriting the annotations of a super class to a child class (which is done using @Inheritence).

For example :


Does anyone know the practical or technical reasoning behind not allowing this? I can't come up with any convincing ones ;)
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
The expert group for JSR-175 (annotations) decided it would keep things simpler. This is from the JSR (I was having trouble getting to the site but I got this from another forum post):

"Why don't you support annotation subtyping (where one annotation type extends another)?
It complicates the annotation type system, and makes it much more difficult to write "Specific Tools" (per the taxonomy in Section VI). "


Jeff Storey
Software Developer
[url]http://jeffastorey.blogspot.com[/url]
R van Vliet
Ranch Hand

Joined: Nov 10, 2007
Posts: 144
Jeff Storey wrote:The expert group for JSR-175 (annotations) decided it would keep things simpler. This is from the JSR (I was having trouble getting to the site but I got this from another forum post):

"Why don't you support annotation subtyping (where one annotation type extends another)?
It complicates the annotation type system, and makes it much more difficult to write "Specific Tools" (per the taxonomy in Section VI). "


Hm, how odd. It would be more straightforward if it reflects the way interfaces work up to a point. I'll read the motivation in the JSR but the "well hey it's too difficult" reasoning seems a bit of an easy out to me.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Annotations Inheritence
 
Similar Threads
JBoss-AOP Annotation Introductions
annotations and packages
Implementing Annotation Question
Query regarding Java Annotation
JSF annotations on interface or abstract class