It's certainly not bad practice. Though, the context depends on your situation entirely.
If you consider the example Guice provides: https://github.com/google/guice/wiki/FrequentlyAskedQuestions#how-do-i-build-two-similar-but-slightly-different-trees-of-objects It's certainly conceivable that in addition to an @Left Leg and a @Right Leg you might want an @Left Arm and an @Right Arm. Depending on your situation there might be other tools that are worth using instead; tools such as child injectors, private injectors, or multi-binders solve similar problems. For example, child injectors are great if you build an object graph for each annotation (or in this context theoretically a 'namespace'). And so on. Pick the one that appears to have the least manual/human overhead and go with that. You can always try another approach if you don't like the direction your current one is going. On Fri, Jan 22, 2016 at 6:55 PM Bingkun Guo <[email protected]> wrote: > For example, bind both class A and class B to annotation @XXX. > > -- > 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 https://groups.google.com/group/google-guice. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-guice/160dc72e-4b78-4ed6-86eb-4826479d3a6c%40googlegroups.com > <https://groups.google.com/d/msgid/google-guice/160dc72e-4b78-4ed6-86eb-4826479d3a6c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAHNex9-UnxH1JCW6ZNpJ%3Dm24_XnwphC_6LCKMOfAgWoEz5M_jQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
