Java 8 allows annotations to appear everywhere a type is used, which allows
for things like
Provider<@Named("name") Thing> provider;
instead of
@Named("name") Provider<Thing> provider;
The first way, to me, seems more semantically accurate, because it reads
"provider of named thing" rather than "named provider of thing." However,
there would obviously be a lot of complication in choosing to support this
syntax. It would be difficult to use the new AnnotatedType reflection APIs
and still support Java 6/7. Ambiguous cases like
@Named("name") Provider<@Named("otherName") Thing> provider;
would have to be detected too. Of the three choices:
(1) Ignore binding annotations on types
(2) Support binding annotations on types
(3) Give a warning/error for binding annotations on types,
I assume Guice is sticking with (1) for now? If someone wrote a patchset
to support AnnotatedTypes in a backwards-compatible way (strategy pattern
for example), would (2), (3), or neither be most likely to get merged?
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.