Clean Architecture Android
Here is a great article explaining the difference between a DAO
and a Repository
. https://www.baeldung.com/java-dao-vs-repository
I would consider the API
as an impromptu DAO
for remote databases.
Since you don't have access to the remote database structure, it will be the closest thing you are going to get to a DAO
.
This Repository
is responsible for collating the two data sources. The DAO
is the local one and the API
is the remote one.
It looks like it retrieves the local data and emits it. It then tries to retrieve the remote data to update the local data. It finally then re-emits the local data.
I think the example you posted falls within the normal responsibilities of a Repository
, as per the article.