android / android/architecture-samples

(All) Avoiding Repositories overhead

Open
#288 2 comments 4 reactions 0 assignees View on GitHub
question
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is named. Review the architecture samples and existing Repository examples first, then clarify and document guidance for repository overhead, shared communication layers, and repository hierarchies; done means the common scenarios have actionable recommendations.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
documentation, mobile-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.