samedi 7 juillet 2018

Data sources vs Repository in Swift

I´ve read a quite voted article about implementing Data Sources in Swift. In summary it is said that a data source conforms a protocol in order to

(...) allow the data to be accesed regardless of the specific details of the framework

behind. Then, at the end of the article the Repository Pattern as a way to handle different data sources (no further details about the implementation or code snippets provided, though).

On the other hand, I've also read this other article about Repository pattern, and looks pretty much the same as data sources, but just using the names NRepositoryinstead of NDataSource?

So, are data sources and repositories the same thing? Or is the Repository a pattern that makes use of Data Sources? In such case... how? Is a Repository actually a Factory of data sources?

Aucun commentaire:

Enregistrer un commentaire