Re: gin field injection
Fields can only be injected after the class has been instantiated. Thus all injected fields are still null during constructor execution. Either refactor your code so you don't need to access the field right away in the constructor or use constructor injection instead. IMHO constructor injection pretty much always wins against field injection. This makes dependencies explicit and you can still use the class without any injection framework.
If you don't want to type all the "this.var = injectedVar" inside the constructor then first type your fields and then let your IDE generate the constructor.
-- J.
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home