DEV Community

Discussion on: Java Records in Spring Boot Rest API

Collapse
 
tobq profile image
Tobi • Edited

Would be so much better if you didn't need the Jackson annotations (and it worked automatically like with normal classes). A lot of duplication / boilerplate

Collapse
 
psideris89 profile image
Panos Sideris

That would be nice indeed. For me it seems a fair trade, having to add annotations instead of declaring a whole class however the most significant benefit it's not the amount of code added or reduced but the immutability the Records offer.

Collapse
 
tobq profile image
Tobi • Edited

It seems like something the devs will eventually get working without annotations, as records are so new (still a preview) . Indeed, the immutability is a great bonus / pattern.