title: Best design pattern to wrap library specific objects?
body: <p>I'm fairly new to design patterns.  What is the best pattern when a developer is using a library (in my case a library to screenscrape HTML) and doesn't want the client/calling classes to be 'stuck' to that library?  </p>
  
  <p>For example, if I am using an class in a library called HtmlPage, and a client says 'getPage()' - I don't want to return the HtmlPage Object from the library but some kind of wrapper of the HtmlPage that I can swap out if I decide to change libraries.  Is it as simple as this?  Or am I missing something?  Would I have to do this for every object in the library?</p>
  
  <pre><code>public class HtmlPageWrapper {
      private HtmlPage htmlPage;
  
      public HtmlPageWrapper(HtmlPage) {}
  
      public getTableOnPage() {
          return htmlPage.getTableOnPage;
      }
  
      // etc...
  
  }
  </code></pre>
  
  <p>Thanks!</p>