title: How to add different set of parameters to factory method design pattern to achieve proper design
body: <p>I have a scenario where two different classes have many properties and one different property. How do I use factory design pattern or should I not use it?
  Internal private methods of these sub classes make use of these properties.</p>
  
  <pre><code>public class RunsValidator  
  {  
       //Few common properties  
       public int DataSegmentID { get; set; }  
       public int AttributeOffset { get; set; }  
  }
  
  public class ProductAttributeRunValidator : RunsValidator  
  {
  
      public ProductAttributeRunValidator(string productNames)
      {
         this.ProdNames = productNames;
      }
  }
  
  public class CategoryAttributeRunValidator : RunsValidator  
  {  
  
       public CategoryAttributeRunValidator(int orgIDs) : base()  
            {  
              this.totalOrgIDs = orgIDs;  
            }  
  
  }  
  </code></pre>
  
  <p>//Factory implementation  </p>
  
  <pre><code>public class RunAttributeFactory  
  {     
  
      public static RunsValidator GetRunValidator(string type, string productNames, int orgIds)  
       {  
        RunsValidator runValidator = null;  
        if(type == "Product")  
        {   
             runValidator = new ProductAttributeRunValidator(productNames);  
        }  
        else if (type == "Category")  
        {  
             runValidator = new CategoryAttributeRunValidator(orgIds);  
        }  
        else  
        {  
            runValidator = null;  
        }  
        return runValidator;  
      }  
  }
  </code></pre>
  
  <p>In the client code, I have access to variables that should be sent as parameters (productNames, orgIds and type) to the Factory method. I would like to access the returned runValidator in many places in the client code as it needs to be set only once based on the type. </p>
  
  <p>Which is the best way to achieve this?</p>