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

Multiple repository #275

Open
BishoyAbd opened this issue Mar 23, 2018 · 2 comments
Open

Multiple repository #275

BishoyAbd opened this issue Mar 23, 2018 · 2 comments

Comments

@BishoyAbd
Copy link

I have some confusion regarding the repository pattern.my question is can I use more than one repository, for example, UserRepository, QuestionRepository, AnotherThingRepository.trying to follow the Single responsibility principle, and then create a Wrapper repository to hold all the repos.

@alexwhb
Copy link

alexwhb commented Mar 27, 2018

@BishoyAbd You can create as many repositories as needed for your project... with that said you should create repositories that are specific and not accessing data outside of their domain to stick to the SRP. Like the User repository should not return data that the QuestionRepository should be returning. If that makes sense.

@mishkaowner
Copy link

@alexwhb obviously that makes no sense. First of all, the repository pattern used in this project is quite different than what the uncle bob introduced in his work. He used it as Domain model gateway. You are just confused with this project (apparently, old 3 tier architecture remix+) and the bob's clean architecture. For the original question, you may have one repo for one entity if you follow bob's clean Arch...

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

No branches or pull requests

3 participants