How can i implement generic service for only CRUD operations #281
-
The way you have implemented GenericDocumentRepository, which can be extended by the respective repository of a feature like merchant, restaurant etc. How can i implement a generic service for CRUD operations? I tried to implement it, but I ran in the diamond problem to have multiple inheritance. Any insight on reusing the code for service class using inheritance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can have a generic service for CRUD if the business rules are the same across all services, which in reality will be unrealistic. There will be several validations to create different models in your application, meaning the way you create a model will be totally different from how you create other models. |
Beta Was this translation helpful? Give feedback.
You can have a generic service for CRUD if the business rules are the same across all services, which in reality will be unrealistic. There will be several validations to create different models in your application, meaning the way you create a model will be totally different from how you create other models.