Power Up Your Java OO Design Skills | Parrot Refactoring Kata

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024

ความคิดเห็น • 21

  • @joseangulo8168
    @joseangulo8168 21 วันที่ผ่านมา +1

    Great video Emily :)

  • @stevend1070
    @stevend1070 7 หลายเดือนก่อน +3

    Really great demo! You leveraged IntelliJ very nicely.

  • @jmkoolboy2071
    @jmkoolboy2071 7 หลายเดือนก่อน

    Thank you for this tutorial, just in 20 minutes I've finally learned how to refactorize!

  • @nyanfpv3179
    @nyanfpv3179 6 หลายเดือนก่อน +1

    Hi!
    Actually inserting the default branch in the factory method (4:06) is not needed. In fact it makes things worse because the compiler will not throw an error during build time if you add another enum value.
    From the docs:
    Exhaustiveness
    Unlike switch statements, the cases of switch expressions must be exhaustive, which means that for all possible values, there must be a matching switch label. Thus, switch expressions normally require a default clause. However, for enum switch expressions that cover all known constants, the compiler inserts an implicit default clause.

    • @EmilyBache-tech-coach
      @EmilyBache-tech-coach  6 หลายเดือนก่อน

      I think you're right, the default branch is not needed. I couldn't work out why my compiler was demanding it. I'm sure you'll do better when you do this exercise!

  • @MrAndrewtux
    @MrAndrewtux 7 หลายเดือนก่อน +1

    Great video and channel.
    Wonderful, splendid accent 🙂

  • @francescolosciale507
    @francescolosciale507 7 หลายเดือนก่อน +1

    Nice video! What's the meaning of R or r before the commit message?

    • @EmilyBache-tech-coach
      @EmilyBache-tech-coach  7 หลายเดือนก่อน +1

      I'm using Arlo's commit notation - an idea by Arlo Belshee that you should include information in your commit about how risky you think the change is. r is less risk than R.

  • @sylvain-k
    @sylvain-k 2 หลายเดือนก่อน +1

    Thanks to do it in java too with intellij, I struggled to find some non equivalency you shown previously with rider. It's weird to see intellij does not automatically update the visibility to protected when pushing down the getSpeed method and force to solve it in this conflict view (not very user friendly imho), then relaunch again the refactoring to make it works :/

    • @EmilyBache-tech-coach
      @EmilyBache-tech-coach  2 หลายเดือนก่อน

      Yes I'm also surprised that IntelliJ doesn't handle this better.

  • @AlexCastroDev
    @AlexCastroDev 7 หลายเดือนก่อน +1

    nice to meet ya

  • @boetjedengel6281
    @boetjedengel6281 7 หลายเดือนก่อน

    I think that eventually the enum should get removed and the parrot construction be as follows: Parrot parrot = new AfricanParrot(...)

    • @EmilyBache-tech-coach
      @EmilyBache-tech-coach  7 หลายเดือนก่อน +1

      In a real system you wouldn't only have the tests to go on - there would be other places constructing these, and then you'd be able to make a more informed decision about that.

  • @HemalVarambhia
    @HemalVarambhia 7 หลายเดือนก่อน

    "I think this was a useful first move" - I inferred a sense of uncertainty. How wrong am I?

    • @EmilyBache-tech-coach
      @EmilyBache-tech-coach  7 หลายเดือนก่อน +1

      I'm always open to there being better ways to design code. This demo just shows the best approach I've found so far.

    • @HemalVarambhia
      @HemalVarambhia 7 หลายเดือนก่อน +1

      @@EmilyBache-tech-coach totally, sometimes, as you put it, the code gets worse before it improves, and I have observed developers stop refactoring at that point.