title: get reference to spring bean from class in src/groovy
body: <p>I'm writing a Grails plugin that defines a Spring bean in the plugin descriptor</p>
  
  <pre><code>def doWithSpring = {
      myBean(MyBean)
  }
  </code></pre>
  
  <p>I need to get a reference to this bean from another class in the plugin. </p>
  
  <pre><code>class Something {
  
    def doIt() {
      // I need to get a reference to myBean here. Is this the best way?
      MyBean myBean = ApplicationHolder.application.mainContext.getBean('myBean')
    }
  }
  </code></pre>
  
  <p><code>Something</code> is a class defined in <code>src/groovy</code> within the same plugin as the bean, but <code>Something</code> is not itself a spring bean. In Grails 1.3.7 is there a better way of achieving this than that shown above? I'm looking for a better way because I know the *Holder classes are deprecated in Grails 2.0</p>