Comment

Comment by gavinray

This post makes mention of a new JEP I hadn't heard of before: "Stable Values"

https://openjdk.org/jeps/502

https://cr.openjdk.org/~pminborg/stable-values2/api/java.bas...

I don't understand the functional difference between the suggested StableValue and Records, or Value Classes.

They define a StableValue as:

  > "A stable value is a holder of contents that can be set at most once."
Records were defined as:

  > "...  classes that act as transparent carriers for immutable data. Records can be thought of as nominal tuples."
And Value Objects/Classes as:

  > "... value objects, class instances that have only final fields and lack object identity."
Both Records and Value Objects are immutable, and hence can only have their contents set upon creation or static initalization.
parent gavinray 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton