What GIN does is to generate the code of your "clientfactory" based on 
annotations in your classes (@Inject and binding annotations such as @Named) 
and bindings in your module (mostly to code against interfaces and tell GIN 
which implementation to use for a given interface, but also to provide the 
code for instantiating a few objects that are not "GIN-aware", i.e. do not 
have @Inject annotations on them).

So, the advantage of GIN is that you write less code.

Without GIN (or any other similar DI library), when you add a dependency in 
a class (e.g. a constructor argument), you have to update your clientfactory 
to provide that value. With GIN, you add your argument to your constructor, 
and that's it, GIN will generate the code that's needed to provide the 
value.

If you need to inject factories or providers of objects, then you'll have to 
code those in your clientfactory. It might just be a matter of 5 or 6 lines 
but still, that's code that GIN would have been able to generate.

Other than that, there's not much differences. Don't feel bad for doing DI 
"by hand", that's the best way to learn what DI buys you. And then you'll be 
able to use GIN and know why you like it and why you do it that way.

Don't do things just because others do it and say it's good to you: 
http://en.wikipedia.org/wiki/Cargo_cult_programming

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/jh0uB8Le9zoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to