SpaceXFollower
SpaceXFollower copied to clipboard
Separate network data layer from local data layer
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
hey @OMIsie11 I'm new to github ! can you guide me through this issue , I would like to fix this ?
can you please elaborate this problem i would like to work on this issue @mrclsu @GeorgCantor @OMIsie11
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.
Thanks for your response , I would like to work on this ! best regards,