Feedback: String Templates (JEP 430)

forax at univ-mlv.fr forax at univ-mlv.fr
Sat Apr 1 06:43:54 UTC 2023


> From: "John Rose" <john.r.rose at oracle.com>
> To: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Reinier Zwitserloot" <reinier at projectlombok.org>, "Brian Goetz"
> <brian.goetz at oracle.com>, "amber-dev" <amber-dev at openjdk.java.net>
> Sent: Friday, March 31, 2023 10:28:00 PM
> Subject: Re: Feedback: String Templates (JEP 430)

> P.S. As a for-instance, a good way to separate the internal concerns of envelope
> logic from the concerns of a payload-providing client is to make the low-level,
> expert-only string interpolation function be protected in the abstract
> DSL-implementor class. Then the clients only use DSL-specific API points, but
> internally the string assembly happens smoothly. I guess that’s not an option
> with interfaces, but it is one of the classic ways to avoid the confusion
> between envelope logic and payload logic

ClassLoader.defineClass is an entrypoint like that, and in practice a lot of people myself included were (before Lookup.defineClass() was added) adding a public method inside the classloader implementation that delegates to the protected method. So while this design may help a little, it is not fundamentally different from a public API. 

Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230401/aec91647/attachment.htm>


More information about the amber-dev mailing list