# Using Repositories to Decouple Android MVVM Data Sources

DevFeed: [Using Repositories to Decouple Android MVVM Data Sources](<https://devfeed.tech/articles/reportoire-the-journey-to-data-source-independency-28080.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/repo-pattern-article/>)

Author: Rafael Ortega Lupión Follow

Published: 2017-01-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Android](<https://devfeed.tech/topics/android.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [data](<https://devfeed.tech/tags/data.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial explains how repositories can keep Android MVVM view models from becoming too large. It presents repositories as an abstraction that selects among data sources, such as memory and network, while improving separation of concerns and testability.

## Source excerpt

Concepts like separation of concerns, logic decoupling or dependency injection are things we developers have heard more than a couple of times. At trivago, the Android app is developed using the Model View ViewModel (MVVM) architecture, aiming for views as dumb as possible, leaving the decision making to the view models. This leads to an increased test coverage since testing logic in views is something we can't do that easily.