title: Which is the better C# class design for dealing with read+write versus readonly
body: <p>I'm contemplating two different class designs for handling a situation where some repositories are read-only while others are read-write. (I don't foresee any need for a write-only repository.)</p>
  
  <hr>
  
  <p><strong>Class Design 1</strong> -- provide all functionality in a base class, then expose applicable functionality publicly in sub classes</p>
  
  <pre><code>public abstract class RepositoryBase
  {
      protected virtual void SelectBase() { // implementation... }
      protected virtual void InsertBase() { // implementation... }
      protected virtual void UpdateBase() { // implementation... }
      protected virtual void DeleteBase() { // implementation... }
  }
  
  public class ReadOnlyRepository : RepositoryBase
  {
      public void Select() { SelectBase(); }
  }
  
  public class ReadWriteRepository : RepositoryBase
  {
      public void Select() { SelectBase(); }
      public void Insert() { InsertBase(); }
      public void Update() { UpdateBase(); }
      public void Delete() { DeleteBase(); }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Class Design 2</strong> - read-write class inherits from read-only class</p>
  
  <pre><code>public class ReadOnlyRepository
  {
      public void Select() { // implementation... }
  }
  
  public class ReadWriteRepository : ReadOnlyRepository
  {
      public void Insert() { // implementation... }
      public void Update() { // implementation... }
      public void Delete() { // implementation... }
  }
  </code></pre>
  
  <hr>
  
  <p>Is one of these designs clearly stronger than the other? If so, which one and why?</p>
  
  <p>P.S. If this sounds like a homework question, it's not, but feel free to use it as one if you want :)</p>