What is differnet between repository and data sour...
# android
a
What is differnet between repository and data source?
😶 1
j
A Datasource allows you to have the access to some source of data like API or database, the repository is in charge to provide access to the data but not giving the client information from which source comes that data. This allows you to replace any data source for another and the client of the repository hasn“t been affected. Take a look to the repository pattern: https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/infrastructure-persistence-layer-design
plus one 2
The article is for C# but the pattern is agnostic to the language
a
Thanks @jgodort , very good.
k
Here’s some good coverage of the data layer https://developer.android.com/topic/architecture/data-layer
m
Strange.. I was just having this discussion with my team the other day. I was trying to find out where the pattern for Repository came from. All I could find was the pattern that Martin Fowler describes, which is much much different than the typical Repository pattern done in Android. As a team we decided that it really is nothing more than an "interface" that lives at the domain layer for abstracting specific implementations.