Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whether to maintain both builder and non-builder patterns #60

Closed
utam0k opened this issue Sep 2, 2021 · 10 comments · Fixed by #61
Closed

Whether to maintain both builder and non-builder patterns #60

utam0k opened this issue Sep 2, 2021 · 10 comments · Fixed by #61

Comments

@utam0k
Copy link
Member

utam0k commented Sep 2, 2021

No description provided.

@saschagrunert
Copy link
Member

I'm personally in favor of the builder pattern 👍

@Furisto
Copy link
Member

Furisto commented Sep 2, 2021

👍

@utam0k
Copy link
Member Author

utam0k commented Sep 2, 2021

I also think that the builder pattern is a traditional Rust design pattern that works well with Default.

@utam0k
Copy link
Member Author

utam0k commented Sep 2, 2021

I think the question is whether or not to continue to maintain both the builder and non-builder patterns. If the maintenance cost seems high, I am in favor of maintaining only the builder pattern.

@saschagrunert
Copy link
Member

saschagrunert commented Sep 2, 2021

Is the switch to the builder pattern a huge change for youki? The main reason to not make it a default was the backwards compatibility.

Anyway, I’m happy to make it default if we agree on it and remove the unnecessary code paths.

@Furisto
Copy link
Member

Furisto commented Sep 2, 2021

I didn't feel it was too much trouble to maintain both so far, so I would be in favor of keeping it as it is for now.

@utam0k
Copy link
Member Author

utam0k commented Sep 2, 2021

Perhaps the fact that fields are separated by private or public is lightly troublesome when writing tests. To be honest, I also think both can be maintained, but I think there will be some surprise for new contributors.
Also, don't worry about large code changes to youki. I'll make those changes myself if no one else is interested!

@yihuaf
Copy link
Contributor

yihuaf commented Sep 2, 2021

I think there are two issue at hand here.

One is whether to use builder pattern and if switch to builder pattern is hard for Youki. I think the current agreement is we like the builder pattern and it is not hard for Youki to integrate (at least we can commit to make the change).

The second issue is if we want to maintain two versions and as a result potentially have duplicated code. As a principle, I don't like this and this may become hard to maintain in the future. With that being said, as a practical matter, I can see the argument that it is maintainable at the moment.

I would favor keeping the builder version only if backward compatibility for Youki is the only concern. Otherwise, I would propose that we be disciplined and limit this repo to only the spec definition and a handful of utility functions such as load and save.

@chenyukang
Copy link
Contributor

In favor of keeping one, anyone is OK.

saschagrunert added a commit to saschagrunert/oci-spec-rs that referenced this issue Sep 3, 2021
Fixes containers#60

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert
Copy link
Member

Proposing the change in #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants