title: When do I use abstract classes versus interfaces with regards to dependency Injection?
body: <p>I have been reading some articles about the SOLID principles and dependency Inversion. From my point of view, I must use an interface to talk to any class. My classes are chatting by using interfaces. </p>
  
  <h3>First Question:</h3>
  
  <p>I am using an abstract class but for the second part of my code, I use an Interface. </p>
  
  <h3>Usage1</h3>
  
  <pre><code>
  namespace DependencyInjection
  {
  
      public interface IMessage
      {
  
      }
      public abstract class Message
      {
          public abstract void Get();
          public abstract void Send();
      }
  
      public class Sms : Message, IMessage
      {
          public override void Get()
          {
              Console.WriteLine("Message Get!");
          }
          public override void Send()
          {
              Console.WriteLine("Message Send!");
          }
      }
  
      public class MessageManager
      {
          private IMessage _message;
  
          public Sms Sms
          {
              get { return _message as Sms; }
              set { _message = value; }
          }
  
          public MessageManager(IMessage message)
          {
              _message = message;
          }
  
      }
  }
  </code></pre>
  
  <p><b>Usage:</b></p>
  
  <pre><code>
  
      class Program
      {
          static void Main(string[] args)
          {
              MessageManager msg = new MessageManager(new Sms());
              msg.Sms.Get();
              msg.Sms.Send();
              Console.Read();
          }
      }
  </code></pre> 
  
  <h3>Usage2</h3>
  
  <pre><code>
  namespace DependencyInjection
  {
  
      public interface IMessage
      {
          public  void Get();
          public  void Send();
      }
  
  
      public class Sms :  IMessage
      {
          public  void IMessage.Get()
          {
              Console.WriteLine("Message Get!");
          }
          public  void IMessage.Send()
          {
              Console.WriteLine("Message Send!");
          }
      }
  
      public class MessageManager
      {
          private IMessage _message;
  
          public Sms Sms
          {
              get { return _message as Sms; }
              set { _message = value; }
          }
  
          public MessageManager(IMessage message)
          {
              _message = message;
          }
  
      }
  }
  </code></pre> 
  
  <p>What is the difference between Usage1 and usage2? When do I choose  usage1 or Usage2?</p>