title: Data Provider or Factory
body: <p>I often get confused with the design term <code>provider</code> and <code>factory</code>. Below is my code to choose a different database context based on the name supplied. I have used a factory pattern here, so i name it as <code>DataContextFactory</code>. Is this correct for this approach? Or do i need to change it to DataContextProvider? will this mean something different implementation?</p>
  
  <pre><code>public class DataContextFactory
  {
      public static DataContext GetDataContext(string databaseName)
      {
          switch (databaseName.ToLower())
          {
              case "app":
                  return new ApplicationDataContext();
              case "customer":
                  return new CustomerDataContext();
              default:
                  return new TestDataContext();
          }
      }
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/1849645/1559213">https://stackoverflow.com/a/1849645/1559213</a> this one confused me</p>