Records -- current status

Stephen Colebourne scolebourne at joda.org
Thu Apr 12 16:02:32 UTC 2018


On 12 April 2018 at 02:22, Brian Goetz <brian.goetz at oracle.com> wrote:
> On 4/11/2018 7:46 PM, Stephen Colebourne wrote:
>> - Records add the ability to convert data in and out in a standard way
>> by a standard field name, exactly as needed by serialization
>> frameworks and similar. However, there is currently no library
>> proposal to provide an abstraction across records, JavaBeans and other
>> classes representing data. I think it would be a mistake to introduce
>> records without also introducing a library providing that abstraction
>> into the java.base module.
>
> The machinery for pattern matching will be that common link.  By providing a
> "principle deconstructor" (and matching it with a constructor of the same
> descriptor), you say to frameworks "here's how to scoop out my data, freeze
> it, and reconstitute me later."

I'm not sure this meets the requirement to abstract over existing
classes without changing them. Great if it does of course.

(for example, one design solution for the requirement would be an
interface that could be implemented in any way, such as using
BeanIntrospector)

Stephen


More information about the amber-dev mailing list