Records: Data classes in Java | Bye Lombok? | Explanation + Tutorial

Sdílet
Vložit
  • čas přidán 21. 08. 2023
  • In this episode we look at Records in Java, introduced in Java 14.
    How to use records, the amazing advantages and what are their limitations.
    Follow me!
    - Twitter: / progwithmati
    - LinkedIn: / matiasdsalerno
    - GitHub: github.com/Programming-with-Mati
  • Věda a technologie

Komentáře • 10

  • @dehorian_stories
    @dehorian_stories Před 11 měsíci

    New sub! Nice info, thanks for sharing

  • @gustavolobos3653
    @gustavolobos3653 Před 11 měsíci +2

    Hi, Mati. I liked the video. It's very clear. Could you please explain better why you avoid using Lombok?

    • @programmingwithmati
      @programmingwithmati  Před 11 měsíci +1

      Hi, thanks for the comment! I will make a follow up video about what I think about Lombok

  • @khmarbaise
    @khmarbaise Před měsícem

    A small inaccuracy... records haven introduced in JDK 14 as preview feature and finalized in JDK 16...

  • @guilhermemelo3760
    @guilhermemelo3760 Před 7 měsíci

    Very cool. Looks like Kotlin

  • @ronySky_
    @ronySky_ Před 11 měsíci +3

    That's a good introduction to Records, but you don't really say why you think this is better than Lombok. Not only moving away from classes you lose the powers of inheritance, but without Lombok you lose builders, which are awesome if you're dealing with models with many fields.
    Not to mention records' alternative to overriding equals/hashcode when not using all fields is much more verbose than using Lombok annotations.

    • @programmingwithmati
      @programmingwithmati  Před 11 měsíci

      Thanks for the comment! I’m preparing a new video on way I’ve started to avoid Lombok

  • @nanonkay5669
    @nanonkay5669 Před měsícem

    The learning gap between Java and kotlin is getting smaller and smaller