Not that I'm shooting down the idea of more work, because we all like working really hard on ColdSpring, right?

But I think we have to achieve a balance between what works well in Spring for Java, and what works well with ColdFusion. CF certainly has idiosyncrasies that just need to be taken into account to make CS work well with the style of development that has grown out of the language itself. I don't know what the correct path may be. I for one am still very against the idea of having init methods callable by CS in parent classes which are not overwritten in child classes, but since it is easily done in ColdFusion, we have to support it. So we need to do what's best for CF here, I guess

Chris

Chris Scott
[EMAIL PROTECTED]
http://cdscott.blogspot.com/
http://www.coldspringframework.org/


GIF image







On Jun 8, 2006, at 4:28 PM, Dave Ross wrote:

Jon,

It really comes down to time vs. benefit. I can see that there is some
benefit to supporting unnamed constructor-args - however my initial
estimate of the time involved is pretty high.

I know that it won't make it into 1.0, but perhaps it's something we
should look at for a future release...For reference:

http://code.coldspringframework.org/browse/CSP-59

thanks,

Dave

On 6/8/06, Jon Gunnip <[EMAIL PROTECTED]> wrote:

Dave,

The two benefits I see to not using named arguments are:
1) can change the names of function arguments (e.g. for more consistent or
better naming) without worrying about breaking any calling code
2) I find it less complex (and more consistent with other languages I've used) to rely on the order of arguments in function calls rather than their
names

Perhaps these benefits are not very valuable to most people or are not of sufficient value to justify some challenging changes to the framework.

Jon


>From: "Dave Ross" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: <[email protected]>
>Subject: [coldspring-dev] Why is name attribute required in
>constructor-arg?
>Date: Thu, 8 Jun 2006 11:40:23 -0400
>
>Java doesn't have named arguments, that's why Spring doesn't even have
>the name="" attribute on the <constuctor-arg/> tag. All ColdFusion
>arguments are named (isn't name="" a required attribute of
><cfargument/> ?) and they aren't "hidden" from anyone (they are
>available in metadata). Many people use the init(argName1=argValue1)
>syntax, and others use init(argumentCollection=structOfArguments). I
>personally do it the way you do (ordered arguments), but I've never
>felt bad about naming them in the CS xml.
>
>Other issues:
>
>Our instantiation logic relies heavily on CFInvoke
>(see line 500 in
>http://code.coldspringframework.org:9010/viewrep/Coldspring2/ coldspring/beans/DefaultXmlBeanFactory.cfc?r=1.36
>)
>
>Autowiring by name would not work.
>
>Factory-bean/method would get messed up.
>
>Basically, I'm not in favor of this. If others are interested, I'd
>like to hear why, but it seems like a lot of work for no perceived
>benefit (IMO)
>
>-Dave
>
>On 6/8/06, Jon Gunnip <[EMAIL PROTECTED]> wrote:
>>
>>Hey,
>>
>>I was wondering why name is a required attribute in the constructor-arg
>>tag.
>> I prefer using <constructor-arg/> over <property/> (especially when the >>components already exist) but I'm uncomfortable binding the ColdSpring XML >>to the names of Init()'s arguments since I always call functions as an >>ordered list and usually consider the argument names to be hidden from the
>>user.
>>
>>Why not just call the Init() with the arguments in the order as they are >>defined in the XML file? This is supported in Spring and according to the >>Spring docs it is the preferred method of using constructor- arg. (they
>>actually recommend specifying the optional index attribute on
>>constructor-arg - e.g. index="0").  See
>>http://static.springframework.org/spring/docs/1.1.5/reference/ beans.html#d0e745
>>
>>Would this just be too messy to implement in CF? I imagine it could be
>>done
>>with Evaluate() or with a switch statement for every possible length of
>>arguments (e.g. 1-argument Init(), 2-argument Init(), etc.).
>>
>>Thanks!
>>Jon
>>
>>
>>
>>
>






Reply via email to