Those kinds of usages are pretty cool, or using it to get to simple
static factory methods and the like, which was the original intent. On
the other hand it's already happened to me that I've tried to abuse it
in a sense; I ended up with a chained sequence of 6-7 method calls to
initialize some static impl. vars in some sun classes. Then I looked at
it, and said, this is so verbose, and only one aspect here will ever
actually have to be configured (changed) in real life usage in my own
app. So I ended up just adding a java class to do most of the init with
and took the stuff out of the context.
So once you have the power to do method calls, the temptation is there
to do stuff in the context that is probably best left as java code, at
least to the extent that it's way less work/less verbose. When/if we get
some sort of expression language in there that will make things
simpler, but I'm sure open up the possibility of even more abuse...
Rod Johnson wrote:
>Colin,
>
>This is a cool feature. I've just used it for the first time, and it makes a
>couple of new idioms possible.
>
>For example, I've added a getStatsMixin() method to
>ApartmentInvokerInterceptor which can optionally be used easily via a
>MethodInvokingFactoryBean to create an Advisor, as in the test suite.
>
>Regards,
>Rod
>
>
|