Here is my quick try at answering your question Java dependency injection pros:
+ Single source of truth (Java files) + Fully refactorable with out of the box Java refactoring tools + Dependency, contracts, and meta-data closest to the code XML dependency injection pros: + Support multiple binding (although this is also possible with Google Guice) + No need to recompile (while this could be an advantage, in Java, you often need to restart the application anyway, so the recompile step is not a deal-breaker) + Completely separate code from object contracts (i.e. Code "cleaner") Also, it is important to not confuse dependency injection and properties. In both cases (XML or Java), you should export the properties in property files and load them separately. Personally, I have moved to Java annotation for mostly everything (DI, ORM, Web Bindings). I think the code is much more manageable when you reduce redundancy and you treat your Java source as the model. I am not against XML, but I personally think that the last decade we overused it, and the current annotation trend is refreshing (this is just a personal opinion) But again, if you like xml files, then Spring is your best bet. Jeremy, On Sun, Jan 24, 2010 at 3:34 PM, fvisticot <[email protected]> wrote: > I'm quite a new google-guice user and i do not understand why no Xml > configuration is available. > Can someone sum-up the PRO and CONS using Xml configuration with > Guice ? > For my point of view, modifying the configuration without > recompilation is an interesting feature... > > What are the external stable projects used for Guice Xml > configuration ? > > Fred > > -- > 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.
