Title: Message
Actually, there was a very good argument against this pre-RedSky. If you cached the CFC you would lose the ability to output.
 
Another reason to not output... and thiis just something to remember, not really an arguments against using output at all - but if you output instead of returning, Flash Remoting can't use the method. Again, it's not a big huge deal, but it's something you _should_ remember before using output.
 
 

=======================================================================
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

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brad Howerter
Sent: Friday, August 08, 2003 12:59 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [CFCDev] Display CFC (aka CFC for display purposes)

I've yet to hear a good argument against having CFCs output HTML, although I've heard some bad ones, namely:
 
1.  You can't do VMC if you do this.  (Sure you can, just create separate methods to output the HTML.)
2.  It just doesn't feel right.  (So get over it already!)
3.  CFCs should only output data.  Just because.  And HTML is NOT data.  (this one's silly, too)
 
Here's some sample code for you:
<cfcomponent>
  <cffunction name="OutputHelloWorld">
    <cfoutput>#helloWorld()#</cfoutput>
  </cffunction>
 
  <cffunction name="HelloWorld"> <!--- keeping the data separate from the display --->
     <cfreturn "Hello, World">
  </cffunction>
</cfcomponent>
 
-----Original Message-----
From: Smith, Don , CTR , WHS/PSD [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 12:47 PM
To: '[EMAIL PROTECTED]'
Subject: [CFCDev] Display CFC (aka CFC for display purposes)

I head a team that includes some VERY junior people.  We have some people who manage small intranet applications.  I built a library of CFCs to handle security and other processing.  It works great and I don't have to worry that someone isn't handling logins correctly, etc.  I have one central library of CFCs that everyone can use.  If you ever had to clean up multiple versions of modified custom tags then you can see this usefullness.
 
I would like to build several central display-only CFCs to do list displays and other kinds of visual actions that these people need help with.  However I'm stumbling over how to do this.  "Display CFCs" are somewhat nonstandard- several developer friends said that they would never use a CFC to display html.  But I know that some of my job cuold be much easier if I didn't have to make sure a custom tag (or as I learned, modified custom tag) was installed on every server, but instead was located centrally.
 
Does anyone have CFC code to share which utilizes HTML, JS and DHTML for display purposes?
 
thanks,
 
Don

Reply via email to