2008/12/12 Anthony MULLER <[email protected]> > Hello, > > I have a little request about next release of Guice. Currently, we have to > use @Inject into the code to say that we want Guice "inject here". > > My concern is we have "import com.google.inject.Inject;" into the class... > It is not really 'my' concern but some guys find it is intrusive... > > So, my proposal is to indicate to Guice the annotation class to use : > Guice.setInjectAnnotationType(my.package.MyInject.class); > > So, Guice looks now for MyInject annotation (instead of standard Inject > one) and I don't have the com.google.inject.Inject import in my class... > > What do you think about this? >
this has been discussed on the list many, many times ;) it would definitely make things more flexible, but people have raised concerns, like it could confuse people new to your code (how do they know that @Wibble actually marks an injection point?) FYI, these are the two longest threads from last year that cover most viewpoints: http://groups.google.com/group/google-guice/browse_thread/thread/28f565a532ce249c http://groups.google.com/group/google-guice/browse_thread/thread/ba2238025cde1604 and you might want to check out James Strachan's patch to support custom annotations: http://macstrac.blogspot.com/2008/10/adding-support-for-postconstruct.html there is also an open issue tracking the original feature request: http://code.google.com/p/google-guice/issues/detail?id=70 however, perhaps this is best left until after the next release - rather than attempt to rush something in at this point... Regards, > Anthony > -- Cheers, Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
