title: Implementing API with replaceable backend implementation in .NET (F#)
body: <p>I'm trying to understand how to implement replaceable components, or a service provider interface, in the .NET world.  I suspect that I just don't know the appropriate terminology to search for.</p>
  
  <p>Specifically, I'm playing around with a <code>Matrix</code> class that has different backends.  At its simplest, a matrix provides two-parameter get and set methods and a constructor.  The implementation is not important to the end user. For instance, depending on the matrices size, the matrix may be backed by an in-memory array, a file, or distributed key-value store.  I would like to hide the backend implementation and allow third parties to provide new backend implementations.</p>
  
  <p>An ideal API, called from IronPython, say, might be something like</p>
  
  <pre><code>a = matrix(data = 0, rows = 1000, cols = 10, backend = 'file://test.txt')
  a[100, 2] = 1
  print a[100, 2]
  </code></pre>
  
  <p>What should I be reading to understand the pattern for this type of problem?</p>
  
  <p>I am playing around in F# and IronPython, but don't believe this question is specific to any particular .Net language.</p>