-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've just found this interesting post:
http://www.alittlemadness.com/2010/06/29/android-functional-testing-vs-dependency-injection/comment-page-1/ I'd just like to share with you a comment that I just posted, because I'd really like to have feedback on this topic before starting working on it. Hi. I'm working on DI in the opposite way. Acknowledging that there are issues (especially the one you mentioned, that is performing the injection at the proper moment in the life cycle), I've first started with the Service Locator pattern (using the same APIs I'm comfortable with), and thinking of DI in a later moment, as a replacement to the Service Locator. A secondary potential problem is the use of reflection, that I've been warned about as being very slow on Android. My current opinion is that DI must be dealt on Android in a different way, that is by auto-generating code in the Activity with a compiler annotator processing tool. That is, if I have @Inject private Foo foo; I'd want to have foo = Locator.find(Foo.class); generated in onCreate(). Lombok could be a proper way to implement the thing. I've kept all the stuff on my mind so far, having other priorities. - -- Fabrizio Giudici - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." java.net/blog/fabriziogiudici - www.tidalwave.it/people fabrizio.giud...@tidalwave.it -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwp3HIACgkQeDweFqgUGxcLzgCgpyFjY5vDGq1YjWSRC2eWSgy/ lG8AoJLe16QlnqTIdJAGzCZE4/XF6KCu =oTtm -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javapo...@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.