...
| Code Block |
|---|
def bb = new grails.spring.BeanBuilder()
bb.beans {
adder(AdderImpl)
calcBean(CalcImpl2) { delegate.adder = adder } // need to use delegate may change
}
def ctx = bb.createApplicationContext()
def calc = ctx.getBean('calcBean')
println calc.doAdd(3, 4) // => 7
|
...