> -----Original Message-----
> From: Ben Rogers [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 28, 2004 4:35 PM
> To: CF-Talk
> Subject: RE: My Init() in my CFC...am I on the right track?
> 
> > This allows you to chain method calls, as others have noted, and will
> > probably help get you more into the habit of using <cfset> and method
> > calls (rather than <cfinvoke> which I also advise against).
> 
> Just to be clear, are you advising people to chain method calls?
> Personally,
> I'm not crazy about this practice. I find it much more difficult to read
> code that does several different things on one line.

Personally I really hate the notion of chaining setter calls (but I can see
way others may like it).  I do find that much harder to read.

But other chaining is great.

Being able to chain the create and the init() together  seems perfectly
sound to me.  As does any call which returns a CFC as a property then calls
a property of that return as in something like this:

<cfset Name = Session.SessionCFC.getUserCFC().getName() />

Without chaining I would find that much harder to read and use (especially
when pulling many properties like this).

I think it's personal preference.

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 like those kind of "there if you want it" kind of compromises.  ;^)

Jim Davis



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188903
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