Data Oriented Programming, Beyond Records

Viktor Klang viktor.klang at oracle.com
Sat Jan 17 16:00:41 UTC 2026


Just a quick note regarding the following, given my experience in this area:

On 2026-01-17 11:36, Remi Forax wrote:
> A de-constructor becomes an instance method that must return a carrier 
> class/carrier interface, a type that has the information to be 
> destructured and the structure has to match the one defined by the type.

This simply *does not work* as a deconstructor cannot be an 
instance-method just like a constructor cannot be an instance method: It 
strictly belongs to the type itself (not the hierarchy) and it doesn't 
play well with implementing multiple interfaces (name clashing), and 
interacts poorly with overload resolution (instead of choosing 
most-specific, you need to select a specific point in the hierarchy to 
call the method).

-- 
Cheers,
√


Viktor Klang
Software Architect, Java Platform Group
Oracle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-experts/attachments/20260117/b6483344/attachment.htm>


More information about the amber-spec-experts mailing list