title: Best practice for getting a derived class to implement a property?
body: <p>Given a simple class hierarchy where each class is derived from an abstract base class.  Every derived class will need to somehow provide an enum "value" which the base class will use in certain base methods.<br/>
  e.g.</p>
  
  <p>Base class:</p>
  
  <pre><code>public abstract class AbstractFoo
  {
    bool SaveFoo()
    {
      switch (BarType){...}
    }
  
  }
  </code></pre>
  
  <p>and derived classes</p>
  
  <pre><code>public class BananaFoo:AbstractFoo
  {
    //barttype = fruit;
  }
  
  public class WhaleFoo:AbstractFoo
  {
    //barttype = mammal;
  }
  </code></pre>
  
  <p>There are a number of ways I can make sure that ALL classes derived from AbstractFoo implement a property "enum BarType"</p>
  
  <pre><code>public abstract BarType BarType{get;}
  </code></pre>
  
  <p>In each derived class I can then implement BarType to return the correct type, or add an abstract method to do a very similar thing.</p>
  
  <pre><code>public BarType BarType{get{return _bartype;}}
  </code></pre>
  
  <p>OR add a concrete method to return a field - then I need to remember to add the field, but it's a lot less typing (C&amp;P)?</p>
  
  <p>What is the recommended way to do this?</p>