From: Matt S. <Mat...@wh...> - 2007-01-11 19:51:43
|
That's certainly a possibility, but what algorithm would be used to try to guess which parameters go where? Would guesses be based on the type of the "parameters" object, or would be reflection be used to try to "extract" the parameters, etc. This could potentially be very complex and still not meet a user's requirements. How often do we encounter objects which do not have a no-arg constructor, especially with Spring having been around for so long? I know I myself would probably never use this feature. That said, if you want to spend some time working on a solution, it's your free time not mine :) Matt Matt Benson wrote: > Thinking more on this, it seems more correct that a > basic implementation of newInstance(Object parameters) > would look for constructors matching the parameters, > and failing to find any would fall back to the > no-parameter version. This would probably be MORE > compatible with any existing InstantiatingReflector > implementation as well. > |