IMHO, one shouldn't need the use/existence of a code framework (e.g. Guice) to show intent. The Java language/syntax provides that very clearly and simply using constructor injection. I concur with Sam that objects should not be constructed without all their dependencies.
On Sun, Nov 24, 2013 at 12:12 PM, Christian Gruber <[email protected]>wrote: > On 24 Nov 2013, at 14:05, Tim Boudreau wrote: > >> Another thing final does is communicate very useful information to someone >> who has to read code someone else wrote. >> > > While I tend to also prefer constructor injection, for reasons stated, I > would point out that @Inject on a field communicates a similar intent - > that is, this is an object managed by an external framework, so mucking > about with the reference is going to give you a bad time. > > Christian. > > > Christian Gruber :: Google, Inc. :: Java Core Libraries :: Dependency > Injection > email: [email protected] :::: mobile: +1 (646) 807-9839 > > -- > 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 http://groups.google.com/group/google-guice. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 http://groups.google.com/group/google-guice. For more options, visit https://groups.google.com/groups/opt_out.
