12 May 2004 18:05
Re: default parms on constructors?
On 12 May 2004, at 16:17, John Stump wrote: > Hello all, > > is it intended for default parameters to work on constructors as > well as methods? I have discovered that they do not work on > ctors. If this should be supported, I can file a bug report. > Thanks There's no reason why we shouldn't support this. Indeed it'd be simpler & easier to support it. Please go ahead and raise the JIRA issue. Incidentally this would make creating Pico style components really easy; allowing default values to specify optional dependencies/values all with a simple, single groovy-constructor (which creates a few different bytecode level constructors that users can call). It also nicely avoids the constructor-hell that is common when you want to provide some flexibility for default values on constructors. Thinking about it more - default values on constructors are probably more useful than on methods :) James ------- http://radio.weblogs.com/0112098/
RSS Feed