Obviously my ToString comparison was bad, and I do agree that it is better to return a string than simply output, it just didn't make sense to me to say that if I had one method that output to the screen I should completely separate it from the rest of the CFC. I had a CFC for my bug tracker that had one method, render(), that would allow for a quick and dirty implementation of the tracker. It just made more sense to me at that time to bundle it with the CFC itself since it was just one method.
 

=======================================================================
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:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] OUTPUT="false", WAS: RFC, CFC Best Practices

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

Reply via email to