title: Factory Pattern: Enum Parameter vs Explicit Method Name?
body: <p>Say you have a factory that returns instances of ILightBulb.  Two ways (there may be more) of implementing the factory are as follows:</p>
  
  <h2>Option 1 - Passing in an enum type</h2>
  
  <pre><code>enum LightBulbType
  {
      Incandescent,
      Halogen,
      Led,
  }
  
  class ILightBulbFactory
  {
      public ILightBulb Create(LightBulbType type)
      {
          switch (type)
          {
              case LightBulbType.Incandescent:
                  return new IncandescentBulb();
              case LightBulbType.Halogen:
                  return new HalogenBulb();
              case LightBulbType.Led:
                  return new LedBulb();
          }
      }
  }
  </code></pre>
  
  <h2>Option 2 - Explicit method names</h2>
  
  <pre><code>class ILightBulbFactory
  {
      public ILightBulb CreateIncandescent()
      {
          return new IncandescentBulb();
      }
  
      public ILightBulb CreateHalogen()
      {
          return new HalogenBulb();
      }
  
      public ILightBulb CreateLed()
      {
          return new LedBulb();
      }
  }
  </code></pre>
  
  <p>Which method is most preferable, and why?</p>
  
  <p>Thanks.</p>