I guess for
me it boils down to the fact that there is no benefit to outputting directly
inside a CFC method, yet there are lots of benefits to not doing it. I
believe it was Barney who pointed out on this thread that separating logic from
presentation is a "good thing" -- plus, even if you have a CFC designed for
display it still doesn't address my very simple and common case of wanting to
build your page output via a series of string concatenations inside CFSCRIPT
(for instance, maybe you want to generate static HTML pages or just pull
together different page elements into a single variable) -- if you output
directly you wouldn't be able to do that, and, more importantly, the end
developer using your CFC now has to be aware of HOW you implemented your
methods, which is the classic no-no of encapsulation.
More to the
point -- what is the BENEFIT of using anything other than OUTPUT="false"
really?
I had no
idea my innocent little best practices document would generate SO MUCH
discussion ;)
-
Nathan
-----Original Message-----At 01:22 PM 3/16/2004, you wrote:
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
Jeffry:
I'll assume the other posts answered your first question about why init() is good
My question was why is using the "psuedo-constructor" bad?
As to why OUTPUT="false" is a good thing -- the main reason is that you don't want to break encapsulation.
What do you think about CFCs designed for the sole purpose of displaying data? ( And by you, I mean anyone on the list who feels the need to share)--
Jeffry Houser, Web Developer <mailto:[EMAIL PROTECTED]>
Aaron Skye, Guitarist / Songwriter <mailto:[EMAIL PROTECTED]>
--
AIM: Reboog711 | Phone: 1-203-379-0773
--
My Books: <http://www.instantcoldfusion.com>
Recording Music: <http://www.fcfstudios.com>
Original Energetic Acoustic Rock: <http://www.farcryfly.com>