Hi Jim, Do you have a problem with non standard annotations or just with annotations in general? JSR 330 is standardizing DI annotations, so, soon they will be standard (and JSR330 are matching pretty well Google Guice http://code.google.com/p/google-guice/wiki/JSR330
As a user (i.e. App developer) I actually prefer annotations to XML for adding metadata to Java code. Annotations is usually much easier to maintain and less verbose than their XML counterpart. Also, Google Guice allows you to override bindings and provides an easy to externalize name/value to property files. Even in the case of Hibernate I have moved to the Annotation way. The only drawback with annotations (especially with Hibernate EJB 3.0 annotations) is that I cannot have multiple (Object/Relational) bindings for the same objects, but 99% I just need only one. Anyway, these are just coding style, they both have their share of pros and cons. Regardless, if you come from Spring XML DI, Google Guice will definitely simplify your life and code. Jeremy, On Thu, Dec 31, 2009 at 4:47 PM, JN <[email protected]> wrote: > I'm looking seriously into the possibility of using guice for our > project. However, I'm extremely reluctant to pepper our interfaces > and implementation classes with guice injections (based on various > principles and practical concerns, I don't find it a good idea). I'd > like to use guice without using annotations, although I suspect it's > not possible. > > Skimming the documentation, it seems like most of the annotations can > be obviated by doing more work in the module. However, doing an > injection (I'd prefer constructor injection) seems to *require* the > @Inject annotation. Is there any way around this? > > Also, if I caved on the @Inject annotation on constructors, is it > realistic to use Guice in a large, complex application and use guice > in complex ways without using the other annotations (= code things > explicitly in the modules)? > > Are people happy with the annotations-mandatory approach? Is there no > demand for alternate means of configuration? I'd rather just specify > everything explicitly in the module, even if it's a little more > verbose. > > Any other good DI containers worth exploring? Stuff I'm aware of: > > Spring -- too much baggage (I want something that only does DI) > PicoContainer -- looks interesting, but guice community seems much > larger. I'm gonna look into it a little more. > yan -- looks dead, so no way I can use; but looked interesting > butterfly -- no Java-based config (need traceability in IDE; not > interested in any non-Java approach) > > Thanks, > Jim > > -- > > 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]<google-guice%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-guice?hl=en. > > > -- Jeremy Chone +1 415 699 9912 -- 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.
