Conversation
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
sophokles73
left a comment
There was a problem hiding this comment.
This basically removes the Type State pattern altogether, doesn't it? With your changes, you can now (again) set any properties on the builder :-(
|
I guess I didn't get what you wanted to do before. |
exactly :-) |
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
|
How about this? Keep using the Type State, but reduce the number of types by using enum. I think it should be simpler. |
sophokles73
left a comment
There was a problem hiding this comment.
Hmm, this seems to only make a tiny difference in code length but only as long as the ConfiguredBuilderState variants are basically immutable, i.e. there are no additional configuration properties supported on them. What I also liked about the previous approach was that we could implement the build function without match because we already now what we are dealing with ...
FMPOV this change does not really improve the code but only makes it less flexible and reduces encapsulation.
|
I see. FMPOV, using match instead of implementing multiple traits, is more readable and easier to understand. Anyway, I don't think this change really matters and needs a lot of discussion. I will close the PR. |
It will be easier to use an enum, and we don't need to declare the Zenoh default config explicitly.