Google I/O 2009 - Big Modular Java with Guice

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

Комментарии • 53

  • @marcusaureliusfanboy
    @marcusaureliusfanboy Год назад +8

    14:30 till this point, they explain why to use DI in the first place
    14:40 why Guice?
    16:52 Bindings
    24:15 Scopes
    28:12 Defining injections
    30:55 Injecting providers
    32:45 Leveraging Guice
    41:00 AOP
    43:45 Introspection SPI
    47:30 how to compose modules

  • @SumanthVepa
    @SumanthVepa 3 года назад +26

    "Wave uses guice, why aren't you". Yeah. That didn't age well.

  • @allyourcode
    @allyourcode 13 лет назад +7

    @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.

  • @asteriondaedalus6859
    @asteriondaedalus6859 7 лет назад +4

    Reinventing Spring? Nah! They are reinventing Borland JBuilder.

  • @krellin
    @krellin 10 лет назад +12

    Why reinventing Spring? there is nothing I saw in this video that could convince me to use Guice instead of Spring. And I'm not even talking about other Spring Projects...

    • @alucard87
      @alucard87 9 лет назад +1

      because guice is typesafe and spring is not?

    • @krellin
      @krellin 9 лет назад

      My post was a while ago, i dont really remember everything i saw about guice, but with proper ide support you have type safety even in your xmls... anyway thats not an argument to switch to anything else... spring provides not only DI it gives a lot of awesome technologies to develop serious enterprize apps... i doubt that with guice you could easily use spring security or spring data or any other component...

    • @bbugarschi
      @bbugarschi 9 лет назад +6

      Vachagan Balayan i guess its a matter of preference. i like guice because it has modules that you could, in theory at least :P, reuse in other apps without copy+pasting the beans.xml. however spring is more of a "kitchen sink" framework, it has way more features compared to guice. it more like a eco-system where guice is more of a lib.

    • @yilativs
      @yilativs 7 лет назад +3

      Spring is type safe.

    • @theren8311
      @theren8311 7 лет назад +1

      github.com/google/guice/wiki/SpringComparison

  • @eatcodesleeprepeat9133
    @eatcodesleeprepeat9133 5 лет назад +1

    Another good google guice tutorial at :
    ruclips.net/p/PLp0ed20U4R4jknb4xYdhx3yJn5RhWECxn

  • @Dzimboo1
    @Dzimboo1 3 года назад +5

    who is 2021 in?

  • @captainhastings3761
    @captainhastings3761 Год назад +2

    R.I.P Bob!! :(

  • @rajeshviswanathan2764
    @rajeshviswanathan2764 Год назад +2

    RIP Bob Lee. :(

  • @allyourcode
    @allyourcode 13 лет назад

    @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.

  • @arsathish
    @arsathish 15 лет назад +1

    guice-servlet module, seems to be like going back. we moved the configuration from servlet code to XML in early 2000 and now we are going back..

  • @MirajGodha
    @MirajGodha 6 лет назад +5

    Why Reinventing Spring?

    • @cybernessful
      @cybernessful 3 года назад +1

      Why reinventing inversion of control?

  • @mtilsted
    @mtilsted 13 лет назад

    @eelakh
    True, but javac don't so it depend on which compiler you use.

  • @zhenfan2725
    @zhenfan2725 4 года назад +2

    watching this in 2020

  • @DragoTama
    @DragoTama 11 лет назад

    I think that the point there is that the setup and teardown are boilerplate, no matter if you do it manually or using the JUnit methods.
    Using Guice you are supposed to not even need to setup and teardown.

  • @shalomshachne
    @shalomshachne 12 лет назад

    Hey guys - what do you think the junit setup/teardown methods are for... Not saying DI isn't needed, but your unit test makes a poor argument...

  • @eragon841
    @eragon841 14 лет назад

    It would still have been a direct dependency, every class that goes into an if block has to be imported (i.e. loaded and initiated).

  • @eelakh
    @eelakh 14 лет назад

    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

  • @rajeshvasudevana
    @rajeshvasudevana 15 лет назад

    Good presentation ! thanks

  • @offmyjacks
    @offmyjacks 12 лет назад +2

    Soo pretty much this is a re-write of Spring.

    • @aquavxi6431
      @aquavxi6431 3 года назад

      @Deonex What do you mean? Im noob with Spring, and I discover this... jejej.

  • @alexwastakenwastaken
    @alexwastakenwastaken 4 года назад +8

    "Google Wave uses it" loool!

  • @DrewSpencer
    @DrewSpencer 12 лет назад +11

    "Well Google wave uses it, so why aren't you?" Shhh!

  • @sriharshacv7760
    @sriharshacv7760 7 лет назад

    Can you share the links to the presentation. The link mentioned above doesn't work.

  • @starbase18portugal
    @starbase18portugal 15 лет назад

    great vid!

  • @phonkey
    @phonkey 11 лет назад

    That's right! That is the Hollywood sign. Very good!

  • @allyourcode
    @allyourcode 12 лет назад

    Sorry, forgot to mention @13:54

  • @AFromPoland
    @AFromPoland 15 лет назад

    Nope, he couldnt use else in this method, because text local variable can be changed in the first if block of code (see: text = shortener.shorten(text);).

  • @Discofunk007
    @Discofunk007 13 лет назад

    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

  • @ebuzertahakanat
    @ebuzertahakanat 8 лет назад

    one word : WELD

  • @muralive
    @muralive 15 лет назад

    I love Guice but don't quite like the infomercial style of making every other way look so ugly at the beginning of the video.

  • @tivrfoa
    @tivrfoa 15 лет назад

    Why he didn't use "else" in the first code? =)

    • @jamesflames6987
      @jamesflames6987 Год назад +1

      Both code blocks are intended to run.

    • @LeandroCoutinho
      @LeandroCoutinho Год назад +1

      @@jamesflames6987 my question from 13 years ago. Thank you! yes, the first if updates 'text'

  • @ertreri
    @ertreri 12 лет назад

    one question though, when you are configuring your depencies in a module, at the end of the line/tree, your leaf dependencies will always have to be classes with no argument constructors, correct? There is no way, that you can configure juice to just inject you a class depends on a Long, for example. You would have to wrap that long in some wrap long class with a no argument constructor, or something of the sort. So, for example, if the smsTwitter need a Locale as input, that would be the end.

  • @FrankConnolly8
    @FrankConnolly8 11 лет назад +2

    I thought it was shadow until I read your comment! Worst. Beard. Ever.

    • @ggsay1687
      @ggsay1687 3 года назад

      I used to have that kind of beard 😆

  • @kumarkashyap3996
    @kumarkashyap3996 2 года назад

    24:34

  • @yilativs
    @yilativs 7 лет назад

    what stops them from creating with new TwitterFactory("mockTestSmsProviderUrl") and not dealing with ugly static methods that won't work in multi-threading environment anyway and will make them always to write a tearDown method to cleanup parameters passed via static method? (i'm talking about ruclips.net/video/hBVJbzAagfs/видео.htmlm20s example)

  • @utsavgupta
    @utsavgupta 14 лет назад +3

    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!

  • @jrodjuiceman
    @jrodjuiceman 10 лет назад +4

    I thought Juice was spelled with a J not G.
    GUICE. JUICE
    GONE. JUNGLE
    GET. JET
    GATHER. JUSTICE
    Maybe that's why my nickname is "JuiceMan" go figure, lol.

    • @IsaacCheng8
      @IsaacCheng8 5 лет назад +4

      When we make discovery or invention, we should always give it a unique name, preferably a short memorable non-word, because most publications are read by machines these days. For example, "p53" is a far better gene name than "her" as the latter is likely to be filtered out by a stoplist of common words, missing out great opportunities of cancer cure discovery by machine learning. By the same token, "guice" is more googleable than "juice." Good job, Google!