Hi guys, I agree with the direction.
I think it's fair to document this in the contributor guidelines, just a note in AGENTS.md and CONTRIBUTING.md is good enough. Let's do that for the new code, no need to change everything on the existing code (we can do step by step). Also, it makes sense to keep Immutables if it's justified. Regards JB On 2026-10-27 22:22 UTC Yufei Gu wrote: > Hi all, > > Can we make Java records the default for simple value types in Polaris? > > Classes like StsDestination, AuthorizationDecision, and > ProductionReadinessCheck.Error have only a few fields. They seem > straightforward to express as records without needing Immutables. > > One reason for using Immutables is avoiding boilerplate. I think that > tradeoff has changed with AI coding. Records already generate the basic > methods, and agents can easily write and update the remaining helpers, such > as factories, validation, and defensive copies. We should focus more on > whether the resulting code is simpler than on the effort of writing those > methods. > > We can keep Immutables where complex builders or existing model hierarchies > make it useful. For simple types, I’d prefer standard Java and fewer > dependencies on generated classes. > > I suggest starting with a few small conversions, checking that behavior > stays the same, and comparing the code. If that looks good, we can document > records as the default for new simple types. > > Thoughts? > Yufei >
