title: Design Pattern - Abstract Factory pattern and Open Closed Principle
body: <p>I am a beginner in design patterns.</p>
  
  <p>I am trying to use Abstract Factory - pattern while maintaining Open-Closed Principle.</p>
  
  <p>Plz look at the following code:</p>
  
  <pre><code>public interface IAbstractFormFactory
      {
          void ShowOSName();        
      }
  
  public class VistaForm : IAbstractFormFactory
      {
          public void ShowOSName()
          {
              Console.WriteLine("Vista");
          }
      }
  
  public class WinXpForm : IAbstractFormFactory
      {
          public void ShowOSName()
          {
              Console.WriteLine("Win XP");
          }
      }
  
  public static class Application
      {
          public static void Run(IAbstractFormFactory factory)
          {
              factory.ShowOSName();
          }
      }
  
  public class Program 
      {
          public static void Main() 
          {
              IAbstractFormFactory form;
  
              int sys = 0;
  
              if (sys == 0) 
              {
                  form = new WinXpForm();
              } 
              else 
              {
                  form = new VistaForm();
              }
  
              Application.Run(form);
  
              Console.ReadLine();
          }
      }
  </code></pre>
  
  <p>can it be an example of Abstract Factory Pattern?</p>
  
  <p>If yes, how can I refactor it incorporating the concept of Open-Closed Principle?</p>