Replies: 1 comment
-
That would be a lot of extra classes to make work. I think it's out of the scope of this project. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The benefit of builders is readability, but there is a risk of missing parameter. Constructor is less readable, but compiler ensures all parameters are present.
Did you consider oneway builder?
Example:
public record NameAndAge(String name, int age){}
Oneway builder is something like
Oneway builder has both: readability and completeness. Completeness, because to get
NameAndAge
you must follow pathname(...).age(...)
and there is no other path to create NameAndAge object.Beta Was this translation helpful? Give feedback.
All reactions