-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor utils package #9
Comments
I'm fine with what you proposed. Just about the interface, a more |
On the other hand, as @technosophos pointed out, the reason for having this repo in the first place is so that people don't have to take a dependency on Duffle - and us moving this back into Duffle means that anywhere people using this package want to store claims on a local filesystem, they will either import Duffle (if we move it back there), or reimplement themselves. |
Well, then I see 2 solutions: |
On IMO, the crud store is sort of an unnecessary abstraction. It would make more sense to just refactor this into a claims storage thing, and only put the claims store in here. (CRUD feels sort of unhelpfully generic). I wasn't viewing this PR as a refactor. But if that is what we'd all like, I can do that. As for the implementation of storage, I am not sure what the reasoning would be for not providing an implementation. If the purpose of the library is to make it easy to implement the spec, then shipping a library that had interfaces but no implementations just means that we have to educate out users not just on how to consume the library, but also how to implement its underpinnings. I mean, I guess I understand not wanting to have a dozen different drivers checked in here... but... they have to get checked in somewhere, and this seems to me to be a better place than in Duffle. |
I agree with removing the crud store abstraction and put all the store implementations here 👍 |
Okay. I will give that a shot on Friday this week, and then get the outstanding PR on Duffle updated to use it. |
As @silvin-lubecki pointed out in #8,
utils
is not an ideal package name - moreover, the package also mixes an interface declaration for a CRUD store, with its filesystem implementation.While this approach mostly made sense for Duffle, now that the package has moved out of Duffle and is intended to be imported by other projects, we should refactor the entire package. Here's what I had in mind:
crud.Store
package back into Duffle.crud.Store
interface into a top-levelcrud
package in this package - not 100% sure this is a good idea though, but at the same time, I also really like this interface being exported, such as consumers can directly useclaimstore.Store
and pass an implementation for this interface.What do you think?
The text was updated successfully, but these errors were encountered: