Skip to content

[Discussion] is it good choice to remove all the repositories as they are just a delegate calls? #97

Answered by arafaysaleem
codinesh asked this question in Q&A
Discussion options

You must be logged in to vote

Nice observation @codinesh. There are a couple of reasons why I don't like to mix up repositories and providers.

While it may look like repositories hold no special logic and can be overriden, that's no true. In this context, repositories are part of the data layer. Whereas providers are part of the domain layer. The objects in the domain layer shouldn't have to worry about fetching the data from the datasource, parsing to validated entities etc. All these tasks should be handled in the data layer like so:

  • Repositories isolate domain models (or entities) from the implementation details of the data sources in the data layer.

  • Repositories convert data transfer objects to validated entit…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arafaysaleem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #95 on January 15, 2022 10:55.