r/java • u/vladmihalceacom • Dec 11 '25
Modern Bytecode Instrumentation with ByteBuddy – Rafael Winterhalter | The Marco Show
https://www.youtube.com/watch?v=AzfhxgkBL9s
40
Upvotes
r/java • u/vladmihalceacom • Dec 11 '25
View all comments
Show parent comment
4
u/JustJustust Dec 12 '25 edited Dec 12 '25
So here's a question that's been bugging me for a while about the argument you're making. Which is:
Classes you'd want builders for are usually some sort of data carriers defined in production code. To replace a builder with named and default params you'd need to define these with the class, that is in production code as well (I assume).
Yet surely 90%+ of my builder usages are exclusively in test code, generating correctly configured test objects is the main usecase I've seen and used builders for.
My intuition is that I'd probably not want test values as default params for my production class, just to rule out they could ever leak into production code. So it would seem that default and named params would not be able to replace builders in test code, which are most builders I've seen so far.
Would you disagree with that?