> Jim Davis wrote:
>>
>> As for returning "this" from a setter... I never thought about it, but I
>> might start (mine all return void now).  I may personally never use it, 
>> but
>> if it doesn't affect performance it leaves to possibility open for others
>> that might want to.
>
> I return "this" from pretty much everything. I don't typically
> use it to chain methods because I find it harder to read, but if
> the next maintainer likes it the code is there for him to use :)
>
> One small additional benefit is where people new to the whole CFC
> thing use code like:
> <cfset object = object.setVar(val)>
> This actually works if you return "this", even if it is not good
> practice.

So am I to understand correctly...that you can ONLY chain methods that 
return "this"? Or that if your init function returns an object then all 
methods can be chained? I'm reading all of this conversation as the former 
(the first one) meaning that if you WANT to be able to chain a method, that 
method needs to return "this". 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188935
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to