Comments (8)
The repository is meant for passing data to and from the domain layer whereas DataSource
s are for pure data operations. The way I see it a Repository
has a one-to-many relation to DataSource
hence the abstraction? That's just my opinion though.
from android-clean-architecture-boilerplate.
@anstaendig you got it wrong, i asked why there is DataStore, why not just DataSource
from android-clean-architecture-boilerplate.
Wait, am I mixing something up here? There's no such thing as a DataSource interface?! Can you clarify?
from android-clean-architecture-boilerplate.
In this pic, you can see it. In code, they should be BufferooCache and BufferooRemote
Why not this approach ?
from android-clean-architecture-boilerplate.
Ah, now I get it. I think the reason is that with one more layer of abstraction you have the freedom to implement the DataSource
s in different ways and then have one interface via the DataStore
. With the approach you mentioned all DataStore
s have the same interface. The approach in here has the flexibility to have different interfaces for cache and data.
I hope I did not mix up things again but now it seems plausible :D
from android-clean-architecture-boilerplate.
With approach i mentioned, you only may have some empty methods in Local or Remote DataSource. But to overcome that, introducing one more abstraction and 2 different interfaces does not look attractive to me :)
from android-clean-architecture-boilerplate.
This is optional. If you have one interface shared between the cache and remote stores then you could end up having a lot of unused methods. The difference between the cache interface and the remote interface is quite a lot, meaning that they'd be a lot of unused bloat in the remote implementation class. THis is likely just personal preference though, no big deal what you go for either way :)
from android-clean-architecture-boilerplate.
Ok 👍
from android-clean-architecture-boilerplate.
Related Issues (20)
- How to add a child fragment?
- Wrong comment on `SingleUseCase.kt`#45
- Useless @Inject in `BrowseBufferoosPresenter`
- Invalid import (BuildConfig) in BufferooApplication.kt HOT 1
- AndroidTest mobile-ui, java.lang.NoClassDefFoundError - Android KitKat
- Useless BrowseActivitySubComponent
- Presentation Gradle has wrong rootProject.ext
- Question: What would it be to build a pagination? HOT 3
- Question about some strange classes... HOT 4
- Domain layer and Application layer separation HOT 1
- Domain Layer Mapping HOT 1
- How does BrowseAdapter inject automatically without any @Provide method? HOT 2
- App not retrieving data HOT 1
- How can I fetch the data from cache when fetching data from remote failed? HOT 1
- Where should the data model for sending between activity/fragment stay. HOT 2
- How would package/modularize by feature fall into this? HOT 1
- Will the presentation models always be useless? HOT 2
- Where do WorkManager, JobScheduler Fit? HOT 2
- Refreshing Coroutines,Flow, KMM,Compose
- Is this project able to run?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-clean-architecture-boilerplate.