What you describe is nothing at all like toString, at least in Java.  Can you think of a method in any Java class that writes to System.out, let alone a toString method that does it?  It's not the CFC's job to determine where the string should go, just how to generate it. On the converse, if it knows where the string should go (output to the HTML stream), then it should NOT know how to generate it.  Separate presentation and logic, and keep it separate.
 
cheers,
barneyb
 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden
Sent: Tuesday, March 16, 2004 1:11 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] OUTPUT="false", WAS: RFC, CFC Best Practices

Why? What if you had one method, lets call it a defaultRender method, that would kind of act like ToString for a CFC. Why is it bad to have this one Output method along with N other methods that work with the CFC?
 

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
Member of Team Macromedia

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barney Boisvert
Sent: Tuesday, March 16, 2004 3:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] OUTPUT="false", WAS: RFC, CFC Best Practices

If a CFC is designed explicitly to output stuff, then it's an exception.  However, if a CFC does that, that ALL it should do. In other words, every method (except private methods) should be output="true".


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffry Houser
Sent: Tuesday, March 16, 2004 12:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] OUTPUT="false", WAS: RFC, CFC Best Practices

At 01:22 PM 3/16/2004, you wrote:

Reply via email to