Updated document on data classes and sealed types
forax at univ-mlv.fr
Sat Mar 2 17:48:49 UTC 2019
So records are only immutable, it's a bold move and i like that.
For beginners we offer a simple model with immutable named tuples and mutable List and Map, very like Python.
I still think we should restrict sealed to interface only (you can always retrofit a class or an abstract class to add a super interface and this will avoid the nesting issue).
----- Mail original -----
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Vendredi 1 Mars 2019 21:14:31
> Objet: Updated document on data classes and sealed types
> I've updated the document on data classes here:
> (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-observers