title: Data sources vs Repository in Swift
body: <p>I´ve read a quite voted article about implementing <a href="https://medium.com/@dcordero/data-sources-in-swift-or-how-to-avoid-that-this-new-trendy-persistency-framework-determines-the-5472fcb75eda" rel="nofollow noreferrer"><strong>Data Sources</strong></a> in Swift. In summary it is said that a data source conforms a protocol in order to </p>
  
  <blockquote>
    <p>(...) allow the data to be accesed regardless of the specific details of the framework</p>
  </blockquote>
  
  <p>behind. Then, at the end of the article the <strong>Repository Pattern</strong> as a way to handle different data sources (no further details about the implementation or code snippets provided, though).</p>
  
  <p>On the other hand, I've also read this other article about <a href="https://medium.com/@frederikjacques/repository-design-pattern-in-swift-952061485aa" rel="nofollow noreferrer"><strong>Repository</strong></a> pattern, and looks pretty much the same as data sources, but just using the names <code>NRepository</code>instead of <code>NDataSource</code>?</p>
  
  <p>So, are data sources and repositories the same thing? Or is the <code>Repository</code> a pattern that makes use of <code>Data Sources</code>? In such case... how? Is a <code>Repository</code> actually a <code>Factory</code> of data sources?   </p>