title: How to avoid implementing methods repeatedly for identical classes?
body: <p>I'm calling the Sharepoint 2007 <code>Lists</code> web service like this:</p>
  
  <pre><code>class ListUpdater
  {
      public void update(ListWS.Lists listService,XmlNode xNode)
      {
          listService.UpdateListItems("myListName", xNode);
      }
  }
  </code></pre>
  
  <p>Because we're migrating to Sharepoint 2013, I need to change this method to:</p>
  
  <pre><code>class ListUpdater
  {
      public void update(ListWS_2013QA.Lists listService,XmlNode xNode)
      {
          listService.UpdateListItems("myListName", xNode);
      }
  }
  </code></pre>
  
  <p>where <code>ListWS_2013QA</code> is the web service at the new URL.</p>
  
  <p>However, I don't want to have to change this everywhere that an instance of the web service is declared, especially if I might have to change the web service multiple times over the application's lifetime.  I was thinking about having an interface <code>IListService</code> so that I could rewrite the method as:</p>
  
  <pre><code>class ListUpdater
  {
      public void update(IListService listService,XmlNode xNode)
      {
          listService.UpdateListItems("myListName", xNode);
      }
  }
  </code></pre>
  
  <p>But then for each version of the web service, I'd have to implement the interface with a wrapper that implements every method of <code>Lists</code> that I use in my code, like so:</p>
  
  <pre><code>class ListsWrapper_2013QA:IListService
  {
      ListWS_2013QA.Lists listService;
  
      public XmlNode DoSomething(string listName, XmlNode listProperties, XmlNode newFields, XmlNode updateFields, XmlNode deleteFields, string listVersion)
      {
          return listService.UpdateList(listName, listProperties, newFields, updateFields, deleteFields, listVersion);
      }
  
      public XmlNode UpdateListItems(string listName, XmlNode updates)
      {
          return listService.UpdateListItems(listName, updates);
      }
  }
  </code></pre>
  
  <p>Is there any way I can take advantage of the fact that <code>ListWS.Lists</code> and <code>ListWS_2013QA</code> already have the same methods, so I don't have to write an extensive wrapper class every time I want to use the <code>Lists</code> service from a different URL?</p>