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

(All) Avoiding Repositories overhead #288

Open
refaelraz opened this issue Feb 21, 2017 · 2 comments
Open

(All) Avoiding Repositories overhead #288

refaelraz opened this issue Feb 21, 2017 · 2 comments
Labels

Comments

@refaelraz
Copy link

Question - best practice for Repository
I know that Repository is a well known pattern but since all examples use this pattern, I believe it's worth the time to describe how to solve common Repositories scenarios.

It seems that applying Repositories for each Object will add a massive amount of overhead
but not doing so, will pollute the code.

example :

  1. Take a login scenario, I need to send a user name /pass to a server and receive a token
    Building a Repository with remote rep to retrieve the token and a local one to store it will be a lot of overhead but to change it, I need to start separate my common communication layers that are being used from inside the Repository (for example - to the Presenters)
    How to overcome that ?
  2. Hierarchy -
    How to handle a situation in which I have inheritance in Repositories ?
    Object Foo
  • Field fooProperty1,2.. (fields in objects of any kind)
  • Field List barList (list of Bar object)

Object Bar

  • Field...

My apologies if it's off topic
BR
Refael

@reinaldomoreira
Copy link

This is a great question. I'll wait for answers as well.

@clivejefferies
Copy link

Surely the repository would be for the top level object and then you would have methods on the repository to retrieve anything it requires from that top level object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@JoseAlcerreca @clivejefferies @reinaldomoreira @refaelraz and others