On Jan 4, 2010, at 1:29 PM, JN wrote: > > Thanks everyone for the discussion. I see people are very zealous > about their particular approaches. Don't need to preach to me, just > looking for technical answers. > > On Dec 31 2009, 3:53 pm, Eelco Hillenius <[email protected]> > wrote: >>> I have no problem with annotations in general. Here are my concerns: >>> - don't want code to depend on guice; jsr would be better here, for >>> the @Inject; but this issue is minor compared to the others >> >> They are annotations, not interfaces. > > My concern still stands.
The point they were trying to make is that annotations aren't required at runtime in the same fashion that interfaces are. You can load a class that uses annotations without the annotations having to be in the classpath. The same holds true during compilation. This was a feature that was added in 1.6 I believe. > >> >>> - don't want interfaces coupled to implementations (referring to some >>> of the apparently optional annotations which I wouldn't use) >> >> You couple it to a default, which you can override in your modules. >> That means that you can avoid a lot of configuration when part of your >> infrastructure runs fine with defaults. Great future, but still >> something that people seem to misinterpret. > > And that's something I don't want to do. I'm not misinterpreting it, > I understand it very well. You can always bind all interfaces to implementations in your module and avoid the @ImplementedBy annotation. However, you can use this annotation to provide defaults and then load the interface class without needing the annotation in the classpath. I guess I'm still wondering what your primary concerns with the annotations are. Could you elaborate on that? -bp -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
