title: What are the pros and cons of using GroovyClassLoader vs. GroovyShell
body: <p>I need to run some external code from my Java application that will be updated frequently and orthogonally to the rest of the application. As I do not to re-deploy the entire application for every code change (and for other reasons as well) we chose to use <a href="http://groovy.codehaus.org/" rel="nofollow noreferrer">groovy</a> for this code, and store it either on the file system or in the database.</p>
  
  <p><a href="http://groovy.codehaus.org/Embedding+Groovy" rel="nofollow noreferrer">From the documentation</a> I understand I have two ways to run the code - Using the <a href="http://groovy.codehaus.org/api/groovy/lang/GroovyShell.html" rel="nofollow noreferrer">GroovyShell</a> or the <a href="http://groovy.codehaus.org/api/groovy/lang/GroovyClassLoader.html" rel="nofollow noreferrer">GroovyClassLoader</a> (eval does not fit here)</p>
  
  <p>What are the pros and cons of each method?</p>