Armando Picón
Jan 24, 2022

--

This is a bad practice. It is not correct because independently if you use interfaces or not, a data source is related to consume data from specific sources, remote (eg. consuming a REST API using a networking library) or local (eg. consuming shared preferences, Room or any other local persistence dependency), and it counts with its own implementation. After, having those implementations, you can inject them into repository where you can apply some strategies to persist your data coming from a remote source, apply caching or let them pass directly to your use case.

--

--

Armando Picón
Armando Picón

Written by Armando Picón

lifelong learner • 👨🏽‍💻 Android eng (ex: @uber ) • 🇵🇪 @ 🇨🇱 • @gdgopen • content creator @devpicon | @primosauda

No responses yet