Designing functional and fluent API: example of the Visitor Pattern by José Paumard

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

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

  • @666KING6666
    @666KING6666 10 месяцев назад +3

    Absolutely bonkers! Love it and hate it at the same time.
    Thankfully, starting with Java21 and type-pattern matching visitors can be replaced with switch expressions. Additionally, if sealed classes/interfaces are used, it can offer a compile-time guarantee that all subtypes in the hierarchy have been properly taken care of. Unlike here, where visiting logic is placed in the registry and only breaks at run-time. And with NPE, of all things!
    Nonetheless, video offers a lot of neat tricks for functional and fluent APIs. I'll surely use them either for builders or custom assertion classes for AssertJ.

  • @andreidei
    @andreidei Год назад +9

    this talk should be entitled "insane people code like this"...

    • @justADeni
      @justADeni 6 месяцев назад +1

      it got pretty good in the middle and then devolved again in the end

  • @badpotato
    @badpotato 2 года назад +1

    this is Nice video.
    it is a different way of solving a problem

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

    Awesome, thank you!

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

    Great presentation.

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

    Very insightful
    Thank you!

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

    1:30 why Visitor Pattern
    3:28 code demo
    3:37 the Visitor Pattern has to visit some *graph* object

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

    Great thank you!

  • @an2ber
    @an2ber Год назад +5

    i hope nobody writes this kind of code in production

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

      It is about learning various tricks. You do not have to write like this. sometimes, to teach, we have to use things like this.

  • @TJ-hs1qm
    @TJ-hs1qm 7 месяцев назад

    9:06 vp violates the GOF rule to never depend on concrete types, only on abstractions. How do you inject MockBody for Body in a test if the code depends on concrete types?

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

    Great Video Learned a lot and a lot of tricks are now in my sleeve !! . Thank you soo much
    34:52 In the Interface X, How can one call define method type() as an instance value out of it , Can anyone share info or notes on the same?

    • @kitkarson4226
      @kitkarson4226 Год назад

      check at 33:44 - type() is a method in the interface X