-
Notifications
You must be signed in to change notification settings - Fork 222
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
Do we have a better implementation for DataManager? #9
Comments
Hi, yes you are right. Having a single |
Hi, I am doing My GsoC Project In which I have implemented the MVP architecture. My project became very big because It started before two years. When I implemented the MVP I made the single DataManager but after Implementation, I found DataManager became very big. Now I am splitting DataManager into multiple. I am thinking to stay with Main DataManager and wire all small datamanager with it Now I have to Implement the Offline functionality (Here we have two modes of Application Online and Offline, we don't need to sync from DatabaseHelper if the Internet is not present or some error occurred during fetching data. If User is online load from REST API and if Offline load from DatabaseHelper). I am confuesd, |
@therajanmaurya I think you don't have to keep all those things in a single DataManager. You can totally split them into model-specific data managers. For instance: UserDataManager manages User related logics and User related only. All data managers follow the same pattern(which holds multiple data sources, local & network or anywhere else) and provide a uniform public interface to the presenters. This seems to be silly but it's well decoupled. After all, you certainly added tons of code for business logics in the past two years, but I guess you won't change or add models in such a frequent manner. |
Thanks @ryanhoo |
As this question Implementing MVP in Android app described, DataManager is a big concern if I am gonna take the architecture applied in ribot.
It's a simple fact that DataManager will grow as the business grows. The ribot android app is just a small demo project and we already have a medium size DataManager here. How would you deal with the problem if the DataManager grows too big?
The text was updated successfully, but these errors were encountered: