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

Separate network data layer from local data layer #2

Open
OMIsie11 opened this issue Oct 3, 2020 · 4 comments
Open

Separate network data layer from local data layer #2

OMIsie11 opened this issue Oct 3, 2020 · 4 comments

Comments

@OMIsie11
Copy link
Owner

OMIsie11 commented Oct 3, 2020

Network data models should be separated from local models used in app to prevent problems on server side.
Things to add:

  • move current data models to remote models
  • add local data models
  • add mappers that handle problems
@yash37158
Copy link

yash37158 commented Oct 12, 2020

hey @OMIsie11 I'm new to github ! can you guide me through this issue , I would like to fix this ?

@yash37158
Copy link

can you please elaborate this problem i would like to work on this issue @mrclsu @GeorgCantor @OMIsie11

@OMIsie11
Copy link
Owner Author

OMIsie11 commented Oct 12, 2020

Hey, I wrote what should be done in first post.
Main problem is the fact that models used in network layer (json data is parsed into them) are also used in other parts of the app.
I think they should be separated into 2 sets of data models. Data mappers should also be added to turn network models into local models.
From my experience of using that API, all fields should be considered nullable and mappers should handle nullability and validation of data that comes from API.
Replacing Json with Moshi should be also considered (and maybe using Moshi Kotlin with default values).
This task requires quite a lot of development and thinking about what can go wrong on API side, because from my experience API can send null objects on almost any field.
It would be nice to test mappers layer also.
Those changes will also affect UI portion of application in some places.
Like I said, it's quite a lot of development.
It would be best to try to do it feature by feature.

@yash37158
Copy link

Thanks for your response , I would like to work on this !
best regards,

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

No branches or pull requests

2 participants