From: Colin S. <col...@ex...> - 2004-11-30 15:02:50
|
The main issue I see, unless I'm missing something, with passing in constructor args to the ProxyFactoryBean is having decent type conversion. When you pass in properties or normal constructor-args to a bean, you get decent PropertyEditor based type conversion happening. The code would need to do something similar to ArgumentConvertingMethodInvoker and its superclass MethodIInvoker. Now the latter are kind of stupid in that they get confused when there are multiple matching methods. If the ProxyFactoryBean variant passed along as the second param a Class[], then there's no ambiguity. It's also more of a pain to use, and maybe should be possible to pass in a null array, in which case the code will do its best, which might be enough when there're only one or two non-ambiguous constructors. But what happens with the constructors from the target bean? They just get ignored? Rob Harrop wrote: > All, > > We really need to come to a desicion of how this should be implemented > if I am to get a fix done in time for 1.1.3. Currently I see two ways > to solve the problem: > > 1. Add setConstructorArgs(Object[], Class[]) to ProxyFactoryBean > 2. Attempt to locate the <constructor-arg> definitions of the target > bean, although I think this involves iterating over the bean > definitions attempting to match to the target. Also when using > anything but a SingletonTargetSource the match might not succeed. > > I am taking a break this week but I will be around for discussion on > this - just won't be starting it until Monday. > > Rob |