Updated document on data classes and sealed types
Brian Goetz
brian.goetz at oracle.com
Fri Mar 1 20:14:31 UTC 2019
I've updated the document on data classes here:
http://cr.openjdk.java.net/~briangoetz/amber/datum.html
(older versions of the document are retained in the same directory for
historical comparison.)
While the previous version was mostly about tradeoffs, this version
takes a much more opinionated interpretation of the feature, offering
more examples of use cases of where it is intended to be used (and not
used). Many of the "under consideration" flexibilities (extension,
mutability, additional fields) have collapsed to their more restrictive
form; while some people will be disappointed because it doesn't solve
the worst of their boilerplate problems, our conclusion is: records are
a powerful feature, but they're not necessarily the delivery vehicle for
easing all the (often self-inflicted) pain of JavaBeans. We can
continue to explore relief for these situations too as separate
features, but trying to be all things to all classes has delayed the
records train long enough, and I'm convince they're separate problems
that want separate solutions. Time to let the records train roll.
I've also combined the information on sealed types in this document, as
the two are so tightly related.
Comments welcome.
More information about the amber-spec-experts
mailing list