title: Parameter passed to Factory Pattern
body: <p>I have a number of optimization models and I have an interface for them.</p>
  
  <pre><code>public interface IOptModel
  {
      public void Optimize();
  }
  </code></pre>
  
  <p>Then, I have a factory class which creates different optimization models. </p>
  
  <pre><code>public class FactoryOptModel
  {
      private Dictionary&lt;string, OptModel&gt; models = new Dictionary&lt;string, OptModel&gt;();
  
      public OptModel getOptModel(string spec)
      {
          foreach(OptModel model in this.models)
              if(spec == "some name")
              {
                  return model_map[spec];
              }
      }
  }
  </code></pre>
  
  <p>My question is that the OptModel needs two parameters to run properly. One is Problem object, and the other is Config object. I expect config object may change in the future as more models are developed. What is the proper design for this? Thanks!</p>