Type: New Feature
Affects Version/s: None
Fix Version/s: None
Last commented by a User:false
This patch adds support for using parameter names when using constructor injection. With this patch the following will be possible:
<bean id="connectionPool" class="ConnectionPoolImpl">
<constructor-arg name="host" value="gbg5"/>
<constructor-arg name="port" value="3066"/>
<constructor-arg name="username" value="bob"/>
<constructor-arg name="password" value="Ns7Ysh"/>
provided that ConnectionPoolImpl has the following constructor:
ConnectionPoolImpl(String host, String port, String username, String password)
The patch also work with static and instance factory methods.
The patch uses ASM to read the local variable debugging information from the .class file of the class being created. This leads to some obvious limitations: the class has to be compiled with local variable debug info and the .class file must be readable from the class path. Even with these limitations I think it would be a nice addition to Spring.
Have a look at my blog for a more detailed description of the technique and why I'd like Spring to support this: http://therning.org/niklas/node/164