griddynamics/banshun — pull request #7 by jirutka (2013-11-10 23:49:58+00:00)
Title: Can be BeanNameAutoProxyCreator replaced with ProxyFactoryBean?

Hi,

what was the reason to implement proxying with `BeanNameAutoProxyCreator`? I’ve tried more straightforward approach – register `ProxyFactoryBean` in `lookup()` method (see [there](https://github.com/jirutka/banshun/blob/without-autoproxy/banshun/core/src/main/java/com/griddynamics/banshun/ContextParentBean.java#L143)) and it seems to work the same way – all tests passes (expect the test of autoproxy of course).

The benefit of this approach is that you don’t need to [declare BeanNameAutoProxyCreator](https://github.com/jirutka/banshun/blob/master/banshun/core/src/test/resources/com/griddynamics/banshun/xml/root-context.xml#L35) in the root context anymore. It’s also more clear what’s going on IMO.

However, with this approach you cannot customize proxying per context like in [this test](https://github.com/jirutka/banshun/blob/master/banshun/core/src/test/resources/com/griddynamics/banshun/coarse-import.xml#L38). I can’t figure out any real use case where such customization can be useful though. Tests passes without it as well.

What do you think about it?