Don't break the chain of love. -----Original Message----- From: Jeff Small [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 29, 2004 11:40 AM To: CF-Talk Subject: Re: My Init() in my CFC...am I on the right track?
> 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 Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188936 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