New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support any annotation in place of @Inject #70
Comments
From crazyboblee on March 15, 2007 13:54:14 I'm not sure 2 is worth it. You still have binding annotations. I suppose we could do I almost think it's better to not worry about this now and concentrate on |
From james.strachan on March 16, 2007 02:19:15 I really like this idea too BTW. There's lots of frameworks which have their own One nit is being able to figure out whether an injection point is mandatory or Binder.addInjectAnnotation(MyInject.class, new InjectionStatus<MyInject>() { This would work if an annotation meant mandatory or optional. e.g. for EJB3 Binder.addInjectAnnotation(Resource.class, new InjectionStatus<Resource>() { |
From ajoo.email on April 27, 2007 08:24:07 +1 |
From ivanobulo on May 02, 2007 05:32:37 -1 |
From skalinic on May 23, 2008 13:51:14 I think that a well-defined set of default injection rules can go a long way toward I think there is a large enough subset of use cases when the binder could figure out What do you think? |
From limpbizkit on June 04, 2008 22:58:16 I think this is more of a 'perceived' problem than a real problem. What applications cannot be written because Labels: -Priority-Medium Priority-Low |
From stolsvik on June 05, 2008 01:08:56 I think it is a very fair wish: one does not want to bind to a specific I do agree with Bob on Comment 1, focus on standardization. In particular, is should The particular issue with JSR 250 annotations is already specifically mentioned in Issue 62 . That issue however took up two things in one go (standard annotations, and Finally, don't get me wrong - I think Guice is awesome! (Even though I get a bit |
From skajotde on December 25, 2008 09:55:28 +1 this feature increase integration level with existing code. at my company major |
From robbie.vanbrabant on December 26, 2008 03:40:36 I am always very skeptical when people talk to me about "framework portability". I So then there's the other issue people are talking about, and what Jesse called the |
From robbie.vanbrabant on December 26, 2008 03:46:01 Correction: |
From stolsvik on December 26, 2008 06:58:26
Letting Guice handle other annotations than its own seems so amazingly obvious and .. and definitely not why it isn't in the code now. Reusable code is a good thing. If the code in questions tags its injection-needs with At this point it is even possible to use a standard set of annotations. That Guice |
From skajotde on December 26, 2008 08:06:58 "I am always very skeptical when people talk to me about <<framework portability>>".. |
From skajotde on December 26, 2008 08:24:55 People at my company prefer write standard code with |
From mcculls on December 26, 2008 08:39:35 I think Robbie's suggestion of allowing other annotations named Support for any annotation would be too flexible, as it wouldn't be obvious where |
From robbie.vanbrabant on December 26, 2008 16:54:54 To answer But indeed, let's stick to "anything named |
From robbie.vanbrabant on December 26, 2008 17:01:48 By the way there's also a downside to anything named |
From limpbizkit on December 26, 2008 19:12:55 If we were to support any annotation with That said, supporting arbitrary annotations with the 'Inject' simple name and no parameters is interesting. |
From erik.putrycz on December 27, 2008 00:08:11 "supporting parameterized annotations is complicated". I think this can be done: |
From stolsvik on December 27, 2008 09:08:51
IoC is a principle so amazingly simple that arguing around "stick with your I find those "If you use Oracle, stick to Oracle" thoughts you display here rather See, some people write code that will have multi-decades lifespans. It is prudent to It seems to me that you think Guice is the end-all of pretty much any frameworks. I, |
From jose.illescas on February 09, 2009 10:59:11 See patch on https://code.google.com/p/google-guice/issues/detail?id=258 note: runtime injection across custom provider to simplifying our "Annotation |
From james.strachan on April 03, 2009 02:54:45 IMHO we can mark this as complete - as is https://code.google.com/p/google-guice/issues/detail?id=258 In GuiceyFruit we have already implemented |
From limpbizkit on April 03, 2009 17:47:23 Yay! Status: Fixed |
From dhanji on April 03, 2009 17:56:03 We still need bind toCtor... |
From kevinb9n on March 15, 2007 13:58:00
Allow any annotation to be used in place of
@
Inject. I believe we wouldnot provide the ability to disable recognition of
@
Inject itself, onlyallow additional annotations to also serve.
A couple possible solutions.
@
MyInjectannotation, and they annotate this annotation itself with
@
Inject. Guicefollows this, treating
@
MyInject as an "alias". Upside: very very simpleto use. Downside: your implementation code now still has a dependency to
guice, it's just been made indirect.
contribute an additional annotation to recognize as being an injection
annotation, and it will automatically become recognized for any class in
your application. Upside: implementation classes have no dependency to
Guice even indirectly. The only thing that remains special about
@
Injectitself is that the Injector happens to addInjectAnnotation() for it
automatically. Downside: I don't see how we could support recognizing the
new annotation "for this module only"; it would probably have to just
automatically apply to everything. People might dislike this, but it's
actually no different from binding an interface -- if your interface is
public, guice is not in the business of stopping anyone from depending on
it who wants to; that's the job of other tools.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=70
The text was updated successfully, but these errors were encountered: