Records -- current status
forax at univ-mlv.fr
Thu Apr 12 17:48:47 UTC 2018
On April 12, 2018 4:02:32 PM UTC, Stephen Colebourne <scolebourne at joda.org> wrote:
>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
>>> 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
>>> classes representing data. I think it would be a mistake to
>>> records without also introducing a library providing that
>>> into the java.base module.
>> The machinery for pattern matching will be that common link. By
>> "principle deconstructor" (and matching it with a constructor of the
>> descriptor), you say to frameworks "here's how to scoop out my data,
>> 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
The Extractor is similar to the BeanIntrospector in its aim but the Extractor is created by the class instead of being created externally so it doesn't break the encapsulation and it only offers a read-only API.
Sent from my Android device with K-9 Mail. Please excuse my brevity.
More information about the amber-dev