Records: Data classes in Java | Bye Lombok? | Explanation + Tutorial
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
New sub! Nice info, thanks for sharing
Thanks for subscribing and the kind comment!
Hi, Mati. I liked the video. It's very clear. Could you please explain better why you avoid using Lombok?
Hi, thanks for the comment! I will make a follow up video about what I think about Lombok
A small inaccuracy... records haven introduced in JDK 14 as preview feature and finalized in JDK 16...
Very cool. Looks like Kotlin
Yes it does!
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.
Thanks for the comment! I’m preparing a new video on way I’ve started to avoid Lombok
The learning gap between Java and kotlin is getting smaller and smaller