title: Serialization of an abstract class
body: <p>I'm trying to serialize, and I am facing a problem with an abstact class.</p>
  
  <p>I googled for an answer, and I found <a href="http://www.geekzilla.co.uk/viewA9CF69B4-0C40-4CEE-A590-496D9EB09C0E.htm" rel="noreferrer">this blogitem</a>.
  I tried that and that work.</p>
  
  <p>Ok, very nice. But check out the comment on the item:</p>
  
  <blockquote>
    <p>This methodology seems to be hiding
    the true problem and that is an
    inaccurate implementation of OO design
    patterns, namely the factory pattern.</p>
    
    <p>Having to change the base class to
    reference any new factory class is
    self-defeating.</p>
    
    <p>With a little after-thought, the code
    can be changed to where any derived
    type can be associated with the
    abstract class (through the miracle of
    interfaces) and no XmlInclude would be
    required.</p>
    
    <p>I suggest further research into
    factory patterns which seems to be
    what you are trying to implement here.</p>
  </blockquote>
  
  <p>What is commenter talking about? He is kinda vague. Can someone explain it more in detail (with an example)? Or is he just talking nonsense? </p>
  
  <p><strong>Update (after reading the first answer)</strong></p>
  
  <p>Why does the commentor talk about </p>
  
  <blockquote>
    <p>factory pattern</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>the code can be changed to where any
    derived type can be associated with
    the abstract class (through the
    miracle of interfaces)</p>
  </blockquote>
  
  <p>?</p>
  
  <p>Does he want to make an interface, like this?</p>
  
  <pre><code>public interface IWorkaround
  {
      void Method();
  }
  
  public class SomeBase : IWorkaround
  {
      public void Method()
      {
          // some logic here
      }
  }
  
  public class SomeConcrete : SomeBase, IWorkaround
  {
      public new void Method()
      {
          base.Method();
      }
  }
  </code></pre>