By bloid
via javablog.co.uk
Published: Feb 06 2008 / 17:28
Everyone’s familiar with using factories and singletons. Google’s Guice library offers an alternative approach based on dependency injection. Their pitch is (paraphrasing) “Do you use factories and singletons? We can offer you a better approach! All you have to do is rewrite your entire codebase with magic annotations.” That’s a heavy pitch. Like a stranger proposing marriage and moving to Denmark. You of course will say no, even if they do look hot and you’ve heard good things about Legoland. This post shows a very simple use of Guice. Think of it as a first date with no strings attached.
Comments
dzonelurker replied ago:
Looks better than Spring but the example lacks necessary explanations.
Voters For This Link (10)
Voters Against This Link (1)