[JSR308] Proposal: Multiple Instance of same Annotation, Annotation Inheritance
Maxim Kizub
mkizub at gmail.com
Wed Oct 8 04:59:46 EDT 2008
Hello.
> > but in Java 6, having @Nodes that contain @Nodes is illegal.
>
>
> Yes, good point. To handle my example, it would be necessary to
> permit recursive/cyclic references that occur within arrays. As
> discussed in the JSR-107 FAQ, this does indeed raise the possibility
> of infinite annotation instances through the use of defaults, unless a
> more involved restriction were put in place.
I disagree with the prohibition of recursive annotations or allowing
them only in arrays. The problem here lays in the requirement to have
non-null values for all annotation constants. But if we allow some
values to be empty (null), we can freely use recursive annotations.
Recursive data types are too common in programming to prohibit them in
annotations.
There are two ways of design - keep it simple or keep it holistic.
More information about the JSR308
mailing list