# Reportoire, the journey to data source independency

DevFeed: [Reportoire, the journey to data source independency](<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: article

Language: en

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

Topics: [MVVM](<https://devfeed.tech/topics/mvvm.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [mvc](<https://devfeed.tech/topics/mvc.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [data](<https://devfeed.tech/tags/data.md>), [decision-making](<https://devfeed.tech/tags/decision-making.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [developers](<https://devfeed.tech/tags/developers.md>), [logic](<https://devfeed.tech/tags/logic.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [model](<https://devfeed.tech/tags/model.md>), [models](<https://devfeed.tech/tags/models.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [source](<https://devfeed.tech/tags/source.md>), [test](<https://devfeed.tech/tags/test.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [view](<https://devfeed.tech/tags/view.md>)

## AI overview

Reportoire separates data access from Android view models through repositories, which choose among data sources and may store retrieved data. The excerpt's `MemoryNetworkRepository` checks memory first, then fetches from the network using `CachedObservableSource` and `MemoryCacheSource`. Developers extend `CachedObservableSource` to define API calls and map results into success or error values. View models obtain repositories through the app's dependency management; the example mentions a custom configurator or Dagger's `@Inject`. This keeps source selection and data handling out of view models, which the excerpt says can otherwise grow difficult to scale and test.

## 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.