I disagree. It's certainly not the 'end of the world', but using direct
output from a method automatically means you won't be able to use the
result remotely via Flash (or as a WS).

Again - this isn't horrible - but it's something you should bear in
mind. (And don't forget the lovely bug with CFCs stored in app/session
scopes - which will be fixed of course.)

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc

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

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

> -----Original Message-----
> From: Matt Liotta [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, December 09, 2002 11:16 AM
> To: CF-Talk
> Subject: RE: CFC output
> 
> 
> It is certainly not a rule or a best practice to avoid 
> directly outputting from a CFC method. There are plenty of 
> good reasons for doing so and making blanket statements like 
> yours only lead to confusion. For example...
> 
>       WriteOutput(someCFC.someMethod());
> 
> Where someMethod() returns a string of HTML as you specified 
> is significantly more expensive than the following.
> 
>       someCFC.someMethod();
> 
> Where someMethod() directly outputs the HTML.
> 
> Matt Liotta
> President & CEO
> Montara Software, Inc.
> http://www.montarasoftware.com/
> 888-408-0900 x901
> 
> > -----Original Message-----
> > From: Raymond Camden [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, December 09, 2002 12:05 PM
> > To: CF-Talk
> > Subject: RE: CFC output
> > 
> > You should not directly output from the method, but should instead 
> > return a string with your output. If you are generating a complex 
> > result, which it sounds like you are, you would probably 
> want to use 
> > cfsavecontent...
> > 
> > <cfsavecontent variable="result">
> >     <b>#title#</b><br>
> >     #foo#
> > </cfsavecontent>
> > 
> > <cfreturn result>
> > 
> >
> ==============================================================
> =========
> > Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> > 
> > Email    : [EMAIL PROTECTED]
> > WWW      : www.camdenfamily.com/morpheus
> > Yahoo IM : morpheus
> > 
> > "My ally is the Force, and a powerful ally it is." - Yoda
> > 
> > > -----Original Message-----
> > > From: Cutter (CF_Talk) [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, December 09, 2002 10:46 AM
> > > To: CF-Talk
> > > Subject: CFC output
> > >
> > >
> > > Does anyone have an example of a CFComponent with a function that 
> > > returns HTML formatted output. Trying to write a function that 
> > > performs a query based on specific arguments then outputs 
> a select 
> > > box based upon
> > > the query results as well as some of the other arguments. I'd like
> to
> > > make it a web service but not sure if possible. 
> (Documentation for 
> > > this stuff seems kinda limited on MM, though I might just be
> > > looking in the
> > > wrong places.)
> > >
> > >
> > 
> > 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to