Comment #8 on issue 658 by sberlin: Make it clear how to do an optional Injector.getInstance
http://code.google.com/p/google-guice/issues/detail?id=658

Sometimes the last resort is the only resort, and this is pretty much the case with framework code that wants to do some funkier things. Still, I would pin the # of getInstance calls more on folks just trying to complete their task in any way they know how, as opposed to doing the "right" thing. getInstance is, at it's best, the last resort to do what you need, but 99% of the time, it's the wrong thing and indicative of some poor design.

I'm with mcculls on the point that the API shouldn't expose every little feature. That's one of the main things of the Guice API -- expose only what's absolutely necessary in the core API, and allow extensions to do the rest. This was one of Bob's key insights in creating it to begin with. The more you offer, the harder it becomes to figure out how to use it properly, and the easier it becomes to hang yourself.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to google-guice-dev@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to