<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"John Rose" <john.r.rose@oracle.com><br><b>To: </b>"Remi Forax" <forax@univ-mlv.fr><br><b>Cc: </b>"Reinier Zwitserloot" <reinier@projectlombok.org>, "Brian Goetz" <brian.goetz@oracle.com>, "amber-dev" <amber-dev@openjdk.java.net><br><b>Sent: </b>Friday, March 31, 2023 10:28:00 PM<br><b>Subject: </b>Re: Feedback: String Templates (JEP 430)<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="font-family: sans-serif;"><div class="markdown" style="white-space: normal;">
<p dir="auto">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 <code style="margin: 0; padding: 0 0.4em; border-radius: 3px; background-color: #F7F7F7;">protected</code> 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</p></div></div></blockquote><div><br></div><div>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.</div><div><br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br></div></div></div></body></html>