Creating the data layer
In this section, we will look at the data layer of an Android application and the components that typically form part of the data layer.
The data layer is the layer in which data is created and managed. This means that this layer is responsible for creating, reading, updating, and deleting data, as well as for managing and ensuring that data from the internet is synced with persistent data.
In the previous chapter, we have seen that use cases depend on an abstraction of a repository class, and there can be multiple repositories for different data types. Repositories represent the entry point into the data layer and are responsible for managing multiple data sources and centralizing the data. The data sources represent the other component of the data layer and are responsible for managing the data of a particular source (internet, Room, data store, and suchlike).
An example of what the data layer for a particular set of data, which uses two data sources...