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

Why do you use Repository pattern just over database only but not also over remote API? #6

Closed
GregPetrov opened this issue Sep 5, 2017 · 2 comments

Comments

@GregPetrov
Copy link

Thanks for code sharing!
Many architecture blueprints I saw (google samples MVP for example) implement repository pattern incapsulating also API calls under repository CRUD methods.
Please, describe why you considered not implement repository pattern the same way?
Thank you.

@janishar
Copy link
Owner

janishar commented Sep 6, 2017

@VanZaant This was done so that the APIs and DB are handled separately. They only are responsible for their own roles and independent of any other application components.

  1. It makes the application loosely coupled with each component having their independent roles.
  2. It allows us to make any external libraries replaceable with ease.
  3. It makes testing easier.
  4. It makes the architecture modular.

@GregPetrov
Copy link
Author

@janishar Thanks for your answer! Have a nice day!

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

2 participants