Google I/O 2009 - Big Modular Java with Guice
Dhanji R. Prasanna, Jesse Wilson
Learn how Google uses the fast, lightweight Guice framework to power some of the largest and most complex applications in the world. Supporting scores of developers, and steep testing and scaling requirements for the web, Guice proves that there is still ample room for a simple, type-safe and dynamic programming model in Java. This session will serve as a simple introduction to Guice, its ecosystem and how we use it at Google.
For presentation slides and all I/O sessions, please go to: code.google.com/events/io/sessions.html
The presentation shows Hollywood sign :)
GirlieBlues 3 months ago
@4:15 Another way would be to have overridable (i.e. non-final) methods that return a Shortener (and another one that returns a Tweeter). That way, you can write a subclass that overrides those methods with their own implementations that return mocks, or whatever.
allyourcode 4 months ago
@7:38 But if you are using JUnit (and it looks like you are), you can (and probably should) perform setup and tear down in the setUp and tearDown methods.
allyourcode 4 months ago
@Discofunk007 You can now use annotations provided by JSR-330, such as javax.inject.Inject. If you don't want to do that, you can always fall back on writing a @Provides method for constructors that you want to inject, but that don't aren't annotated with @Inject. For example, @Provides TweetClient provideTwitterClient(Tweeter tweeter, Shortener shortener) { return new TweetClient(tweeter, shortener); }
tomfitzhenry 4 months ago
You stole my name: Jeffrey Pipes Guice!!!! Check out my Facebook page called Jeffrey Pipes Guice.
jeffguice1959 6 months ago
At 44:58 he says "ninety" like a robot.
slugmandrew 7 months ago
Don't like that there is a dependency on Guice for the annotations (or is there?). Should default to use the constructor with the most parameters
Discofunk007 7 months ago
@eelakh
True, but javac don't so it depend on which compiler you use.
mtilsted 1 year ago
At around 7th minute Jesse says if you compile a module you have to compile everything that it depends on?!!! it's not true. Test for yourself if you don't believe me. Define a class and inside one of the methods call another class that you've defined compile it. Then see the time of creation of the class files. Then go back and change the dependent class and compile again. It will still work without needing to compile the other class again. IDEs also keep track of these dependencies
eelakh 1 year ago
Hollywood principle "don't call us, we'll call you."
Bollywood principle "call us, we won't call you. No balance dude!"
Haha... No offense, just a joke!
utsavgupta 1 year ago