Tuesday, March 31, 2020

Java Records Are Here - Available in JDK 14


We need justification not to use immutable objects in ours solutions, rather than an affirmative reason to use them.
Records provide a first-class means for modeling data-only aggregates. They are available in Java since release of JDK 14.

Records are often seen as syntactic sugar to easily create immutable objects without having to write a lot of boilerplate code. And records as a clean definition of immutable objects can have a tremendous impact on your component design.

You as a designer have to reflect why your abstractions are not immutable and what is the rational behind. From experience it improves greatly the quality of your design.