Hello, Thanks for this quick answer.
I do not pretend to compete with Guice, but let's try to answer your question: Google Guice provides a reflection oriented dependency injection container. The AOP version provides fast reflection using cglib, but this version cannot be used with Android (source: http://code.google.com/p/google-guice/wiki/OptionalAOP). So using Guice in Android, we are stuck with "slow" reflection. And Guice uses a lot of reflection. Furthermore, Guice provides a "type" oriented injection, whereas Yasdic provides an "id" oriented injection. Which one is better ? I guess it's up to you. You are free to have a look at the Android example here: http://code.google.com/p/yasdic/source/browse/#svn/trunk/examples/countadroid I think Yasdic is much simpler and much faster to learn than Guice, but it requires a bit more writing. Beans are defined in a programmatic style, writing code in anonymous classes. This allows you to do anything when initializing beans, even complex computations involving multiple beans. Maybe I should make some speed / memory tests, to see what's the real difference. Any suggestion about this will be welcome, to prevent me from writing an "unfair" test ;-) . Regards, Piwaï On 30 juin, 21:18, "Fred Grott(shareme)" <fred.gr...@gmail.com> wrote: > What is wrong with using Google Guice non-aop? > > On Jun 30, 5:12 am, Piwaï <py.ri...@gmail.com> wrote: > > > Hello developers, > > > I have been using the Android SDK for a few months now, and one thing > > I was missing was a dependency injection container. > > Dependency injection is a good practice to lower the coupling between > > the components of your application. > > > I thought about using Spring, or PicoContainer but they use the > > reflection API to provide dependency injection. And the reflection API > > may not be the best speed partner for your Android apps. > > I couldn't find any real small dependency injection container, that > > would provide dependency injection without reflection. > > > Here comesYasdic, "Yet Another Small Dependency Injection Container", > > no more then 6.7KB. > > > The definitions are written programmatically and stored by String ids, > > the beans are lazily created, andYasdicalso deals with singleton and > > prototype scopes, cyclic dependency, and container hierarchy. > > > Please feel free to try it out :http://code.google.com/p/yasdic > > > I already use it in my Android apps, and I find my code to be much > > more maintainable (thought this is a quite subjective point of > > view ;-) ). > > > Any feedback on this project will be appreciated, even code > > criticism :-) . > > > Regards and thanks ! > > > Piwaï --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---