-
Notifications
You must be signed in to change notification settings - Fork 211
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
Break up the repository into multiple traits #100
Comments
This makes sense to me just for standardizing across multiple types of data. Is there a function we would write that would only rely on an instance of Here's one I came up with that saves an object, does some operation, and then cleans it up.
There's also the issue about how to generalize/standardize across just data generated by the database. I've played with this a bit in another project: CRUDAlgebra/CRUDService: Example typeclass extending CRUDAlgebra: Example instance of the typeclass: |
That's an interesting idea. However, the only thing I have a question about is how would you make those attributes stackable? I.e. if you had a caching or notification layer on each of those operations? |
Hm perhaps by an interesting choice of |
It is an interesting idea. I like the idea of a CRUD algebra, because you assume you have to create/update/delete/getById on everything. |
I like that because the CRUD operations vary from service to service. Some services don't have deletes, some have getById, etc. |
A lot of the logic in the repositories looks replicated throughout all of the repositories. This may be better to break this up into reusable traits.
I.e.:
OrderService extends ... with Creatable[t] with Deleteable[T] with Updateable[T]
The text was updated successfully, but these errors were encountered: