I posted my reply in the comments section on the post. Here's what it says...
Yes, it is possible to do DI by hand. And in small applications, the amount of code required to construct objects is comparable. But for multiple-developer applications, you’ll write less code if you use a framework. Before you abandon Guice, consider a few things that your post has overlooked… Lazy initialization via Providers. Wherever you want you can defer initialization of a dependency by injecting a Provider rather than a Foo. Doing this with by-hand DI is possible, but your code size will blow up significantly. Particularly since you’ll need to rewrite every path that uses a given dependency. HTTP sessions and request scoping. Without a framework, working with session objects is ugly. You need to think about concurrency, mapping keys to values, and casting. Guice takes care of all of this for you with just an annotation: @SessionScoped. Modularity. You can reuse Guice modules across applications. The module is a unit of encapsulation, and no single piece of code needs to know the implementation classes of multiple modules. -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
