JDK 14 Preview Records constructors
forax at univ-mlv.fr
forax at univ-mlv.fr
Tue Jun 9 21:27:24 UTC 2020
----- Mail original -----
> De: "org openjdk" <org.openjdk at io7m.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "interlink sg7" <interlink.sg7 at gmail.com>, "amber-dev" <amber-dev at openjdk.java.net>, "amber-spec-comments"
> <amber-spec-comments at openjdk.java.net>
> Envoyé: Mardi 9 Juin 2020 22:51:14
> Objet: Re: JDK 14 Preview Records constructors
> On 2020-06-09T22:35:23 +0200
> Remi Forax <forax at univ-mlv.fr> wrote:
>>
>> There is a bit of theory behind the compact constructor, it's a way to define
>> preconditions [1] in a design by contract way [2],
>
> That's only really true if the conditions inside the constructor become
> visible in the JavaDoc. I can dream, can't I? :)
You can dream :)
given that unlike Eiffel the compact constructor let you write any valid Java statements, being able to surface them in a meaningful way in the Javadoc is not that easy.
But if you take the idea the other way, have some special tags in the Javadoc like @ensure and generate the code of the compact constructor, it looks like like a nice project for my students, i will say to my student that it's your fault if they have that project to do :)
Rémi
>
> --
> Mark Raynsford | https://www.io7m.com
More information about the amber-dev
mailing list