Relative Content

Tag Archive for androidarchitecturedomain-driven-designclean-architecturebusiness-logic

Implementing Data Source Selection Logic in Clean Architecture: Domain or Data Layer?

I’m trying to properly design an application according to clean architecture, but I’m struggling to determine on which layer (data/domain) to implement certain logic. In my application, there’s a feature that displays data (user contacts) which can be either set locally in settings or retrieved through an API. Which version to show the user depends on other settings and the app’s usage mode, for example, the API returns data, but the user has set a preference for using local data in the app’s settings. On which layer should I implement the logic for choosing the data source?