Hacker Newsnew | past | comments | ask | show | jobs | submit | rakila's commentslogin

Go for Guice if you just want DI. You won't regret it. But always remember, all "auto" stuff might mislead you. For example, you need somebody to start things for you, so in Spring, the Servlet container will invoke the Spring Servlet, which will take things up from there. That's the catch, it's not magic, right? So with Guice, you need to figure out who will so that "auto" for you. Btw, if you're just building a small library, Guice is definitely the DI choice. HTH.


From the article, the author clearly states he has issues with the DI-driven design in general; Spring just happened to be the DI framework he was using at the time. Guice or any other framework for that matter would not have made any difference.

Money quotes:

>>>> In the end, creating a coherent, small system is to me of much higher value than to create one that is decoupled just for the sake of decoupling. Coherence and decoupling are opposing forces and I side with coherence.

>>>> So reuse and decoupling are opposing forces. I find myself siding with decoupling.


There is also Dagger (developed by Square) http://square.github.io/dagger/

Pretty similar to Guice, but faster.


Ha, Bob doing another DI framework? Is it any good?


If it's a library, not an app, it's better not to rely on DI at all, leaving the choice of container to user. As a library designer you can implement reasonable manual auto-wiring of default configuration.

For small applications (both server-side and client-side) Spring 4 is as easy to use as Guice.


Trying to help find, attend and share what is exciting lately. The sources are completely open :-) I have facilitated private events and closed groups to share comments and photos. I did this because I believe proper socializing happens in real world and the place you socialize matters a lot.

So far we've had a bumpy ride but I am commited to make it work to build a rather truly social planet!

Thanks @michael_fine!

http://www.ilikeplaces.com


Recommended reading: "Rework" by Jason Fried and David Heinemeier Hansson, and "Getting Real". Both by 37 signals-the ruby on rails guys. Best of luck!:) trust me, they are well worth the buy...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: