title: Abstract method vs static method in Program class
body: <p>Say I've got a simple inheritance chain where <code>Employee</code> is the abstract base class and <code>Checkout</code> and <code>Manager</code> inherit from it in this purely illustrative console app.  Now I want to have a method that will take in an object of type <code>Manager</code> or <code>Checkout</code> and return an integer amount of a bonus depending on the position in the company of the employee.  I had some initial thoughts on doing this, and would like to know potential long-term deficits or gains from each approach if this console app were to one day grow up to be a data-driven web application. </p>
  
  <ol>
  <li><p>Use an interface common to the inherited classes.
  My base class looks like </p>
  
  <pre><code>abstract class Employee
      {
          public int EmployeeId { get; set; }
          public string FirstName { get; set; }
          public string LastName { get; set; }
  
  
      }
  </code></pre>
  
  <p>and my derived classes implement an interface designed to print employee information to the console called <code>IPrintable</code> and only has one method to do so.  Although this interface has nothing to do with giving bonuses I mocked up the following in the class with my <code>Main</code> method lives and the program runs fine.</p>
  
  <pre><code>static int GiveBonusesViaInterface(IPrintable i)
          {
              if (i is Checkout)
                  return 1000;
              else 
                  return 2000;
  
  
          }
  </code></pre>
  
  <p>It seems to me that if I wanted to use an interface for this I should probably make another one specific to giving raises instead of riding the coattails on an already-implemented interface (but that's another question for another day). </p></li>
  <li><p>Use a static method in the base class like</p>
  
  <pre><code>public static int GiveBonus(Employee e)
          {
              if (e is Manager)
                  return 2000;
              else
                  return 1000;
          }
  </code></pre></li>
  <li><p>Make an abstract method in the abstract base class and nave derived classes implement as they see fit</p>
  
  <pre><code>abstract class Employee
  //fields and constructors
  {
  public abstract int GiveBonusesViaAbstractMethod(Employee e); 
  }
  </code></pre></li>
  </ol>
  
  <p>This seems to be the worst idea to me because there will have to be a method in each derived class that takes in a parameter of <code>IPrintable</code> or <code>Employee</code> type and in the Manager class we'd have to test if the employee <code>is-a</code> Manager.  </p>
  
  <p>Are 1-2 equally as scalable and managable for a long-term web application?  Is option 3 really as bad as I made it out?</p>