<html><head><style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] { list-style-position: inside;}
body { font-family: 'Segoe UI'; font-size: 12pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
--></style></head><body><div>You can consider using an annotation processor to create builders for such records -- for records with that many parameters, that's probably a good idea anyway.</div><div><br /></div><div>Although Lombok is often used for this, there are alternatives as well. I can recommend taking a look at <a href="https://github.com/Randgalt/record-builder" style="font-size: 12pt;">https://github.com/Randgalt/record-builder</a></div><div><br /></div><div>If you are only "mapping" such records instead of creating them manually, you may take a look at mapping frameworks (like mapstruct).</div><div><br /></div><div>--John</div>
<div><br /></div>
<div>------ Original Message ------</div>
<div>From "Roel Meeuws" <<a href="mailto:r.j.meeuws@gmail.com">r.j.meeuws@gmail.com</a>></div>
<div>To "Pedro Lamarão" <<a href="mailto:pedro.lamarao@prodist.com.br">pedro.lamarao@prodist.com.br</a>></div>
<div>Cc <a href="mailto:amber-dev@openjdk.org">amber-dev@openjdk.org</a></div>
<div>Date 11/01/2024 14:59:55</div>
<div>Subject Re: Possible optimized record construction in order to use as DTO</div><div><br /></div>
<div id="x95ce1405f0a747d"><blockquote cite="CAK-vHexs+j38=EdWyH1DvOvmEKsFZhVqq-yKUaHBy6RFQTB6wg@mail.gmail.com" type="cite" class="cite2">
<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Hi Pedro,</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br /></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">My editor will also insert these, but:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"> * not all my colleagues have that in their editors</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"> * The perceived formatting is impacted by inserting these words between the text</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"> * This is not working for me in e.g. Eclipse when the method call is not finalized yet or there is a compile error (because I am still typing).</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br /></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>Roel</div><div><br /></div><div>--------------------------------------------<br />Roel Meeuws<br />Email: <a href="mailto:r.j.meeuws@gmail.com">r.j.meeuws@gmail.com</a><br />Mob. phone: +31 (0)6 10 82 44 01<br />--------------------------------------------</div></div></div><br /></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /><table style="border-top:1px solid #d3d4de"><tbody><tr><td style="width:55px;padding-top:13px"><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-green-avg-v1.png" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td><td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free.<a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:#4453ea">www.avg.com</a></td></tr></tbody></table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><br /><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op do 11 jan 2024 om 14:50 schreef Pedro Lamarão <<a href="mailto:pedro.lamarao@prodist.com.br">pedro.lamarao@prodist.com.br</a>>:<br /></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello! My observation is below.</div><div dir="ltr"><br /></div><div dir="ltr">Em qui., 11 de jan. de 2024 às 09:50, Roel Meeuws <<a href="mailto:r.j.meeuws@gmail.com">r.j.meeuws@gmail.com</a>> escreveu:<br /></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:monospace,monospace;font-size:small">now let's construct this:</div><div style="font-family:monospace,monospace;font-size:small">var line = new IrritatinglyBigEUReportLine(</div><div style="font-family:monospace,monospace;font-size:small"> 12345,</div><div style="font-family:monospace,monospace;font-size:small"> ZonedDateTime.now(),</div><div style="font-family:monospace,monospace;font-size:small"> "John",</div><div style="font-family:monospace,monospace;font-size:small"> "Doe",</div><div style="font-family:monospace,monospace;font-size:small"> "529900T8BM49AURSDO55",</div><div style="font-family:monospace,monospace;font-size:small"> BigDecimal.valueOf("100.0"),</div><div style="font-family:monospace,monospace;font-size:small"> BigDecimal.valueOf("100.0"),<br /></div><div style="font-family:monospace,monospace;font-size:small"> BigDecimal.valueOf("100.0"),<br /></div><div style="font-family:monospace,monospace;font-size:small"> BigDecimal.valueOf("100.0"), // anyone knows what this value is here?<br /></div><div style="font-family:monospace,monospace;font-size:small"> ...</div><div style="font-family:monospace,monospace;font-size:small">);</div></div></blockquote><div><br /></div><div>I think this is an interesting usability problem that has many solutions.<br /></div><div>My IDE, for example, puts a small widget in front of that line, showing the name of the parameter.</div><div>I suspect many good editors today will show the name of the parameter with some UX gesture, such as mouse rovering, or placing the caret at the position and doing some key combination.<br /></div><div></div><div>Many such problems are best solved by the editor.</div><div><br /></div></div><span class="gmail_signature_prefix">-- </span><br /><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Pedro Lamarão</div></div></div></div>
</blockquote></div>
</blockquote></div>
</body></html>