Comments (5)
I think this all about tradeoffs. The model duplication being done in this repo is not just because architecture restricts us from using certain Framework APIs or other logically separated APIs. It is also because a single module can treated as independent entity in some level. For example the person responsible for domain changes the "Platform" file and breaks the other modules in every place they use that Platform Enum. Rather than that Using the convention in this repo, it will only break the mapper function which can be fixed easily and specially at a single place in a single module rather than countless places where the "Platform" enums are being used. This will give more confidence to a programmer responsible for a module to bring changes. This makes the code less explosive even when it explodes when someone touches it. This is my understanding on this thing.
from clean-architecture-components-boilerplate.
@erluxman , in this case, Remote->Data mapper is inside Remote repo, and that looks a bit strange
I mean the question is not in that each layer has own model, but how layers depend on each other
UI->Presentation->Domain<-Data<-Remote
from clean-architecture-components-boilerplate.
Yeah this has been one of my question too. I had made a issue in its original repo (not android architecture one). That confuses me too but the principle in itself is justifiable. I am also looking at the project and see if I can do something to make it more clear and concise.
from clean-architecture-components-boilerplate.
@erluxman well, it looks a bit strange that we do a separate "independent" modules, that actually have 1:1 dependency to business logic, and if we would like to reuse "Remote" layer, it will have to add new Mapper for new "Data" layer, instead of "Data" writing mapper by itself and "Remote" being easily pluggable unit
from clean-architecture-components-boilerplate.
Hey @Dwite & @erluxman - the BufferooRemoteDataStore.kt in the data layer is not actually the implementation of the remote source, but more of an abstraction of this logic out of the BufferooDataRepository.kt class. This Remote source is just an example of a way to organise things, it is not necessarily needed to follow clean architecture, for example, you could communicate with the remote layer via the interface directly from the BufferooDataRepository. The Remote->Data mapper is inside of the Remote layer because of the directions in which the dependencies point - whilst this written out may look different from the clean architecture onion diagram, you can still separate these modules out into the diagram and it would represent a clean approach. IN my view, data should not know about the source modules (remote and cache) but instead, they should be injected in - which is how we have done it in this project. I feel this keeps the data layer unknown to outer sources. But with any projects, it is up to you how you structure things (whatever works best for you and your team :) )
Remote is still an easily pluggable unit at this point, the data layer only has an interface which is used by the remote layer - the data layer does not depend on the remote layer in any way.
from clean-architecture-components-boilerplate.
Related Issues (13)
- @PerActivty scope
- CompositeDisposable dispose vs clear in FlowableUseCase HOT 3
- saveBufferoos is called even when data is retrieved from cache HOT 2
- Decoupling mobile-ui HOT 1
- How to implement onClick for RecyclerView? HOT 1
- Android Studio 3.2 Canary 14 Doesn't find any tests HOT 4
- BufferroosDataStore does not need all function HOT 1
- Java 1.7 support
- Why is BufferooEntity in the data layer?
- BrowseBufferoosViewModel doesn't survive configuration change HOT 2
- BrowseBufferoosViewModelFactory doesn't support multiple ViewModel subclasses HOT 2
- I can't build project HOT 1
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 clean-architecture-components-boilerplate.