Actually, assuming you've already created the instance, CFCs are much faster then 
custom tags.  Creating an instance is still slow, about the same as invoking a custom 
tag. But assuming you've already created the CFC instance to get the data, calling a 
second method to display is about the same speed as calling a local UDF (aka. A lot 
faster then a custom tag). This is only true in CFMX 6.1, 6.0 was much slower, so if 
you haven't upgraded yet this is a good reason.

As for display methods; this was hashed out a lot way back when CFC first appeared, 
I'm glad to see it hasn't become the religious war that THIS scope has/did. But my 2 
cents. I like using CFCs for display, basically I like the idea that the cfc knows 
everything about itself, have to create,edit,delete, and display itself. Now if I need 
multiple display formats (html, flash, etc) then I will put all the display methods 
for one format in one cfc and extend the base cfc with the data methods (but that's 
not a usual need). 

The other thing that really helps, All of my display methods include the display code 
instead of putting it inline in the cfc. Usually I create a folder under the cfc 
location with a name of "_CFCNAME" and then create a METHODNAME.cfm file, one for each 
method. And the methods are nothing but the cfargument tags, one include, and the 
return method. Considering the HTML can get real long, this really helps keep a CFC 
with many methods manageable, I even do this for the larger data methods too.

Hth,
---nimer

-----Original Message-----
From: Matt Liotta [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2003 5:39 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Display in CFCs


CFCs are pretty heavy-weight for simply display logic, so while it is 
possible and there is nothing wrong with using a CFC wherever you would 
use a custom tag there will be performance implications that shouldn't 
be taken lightly.

-Matt

On Friday, August 29, 2003, at 05:27 PM, Brad Howerter wrote:

> I say "Custom tags aren't needed anymore now that we have CFCs".
>
> -----Original Message-----
> From: Dawson, Michael [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 29, 2003 3:23 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Display in CFCs
>
>
> I agree, however, the main point of my original question is:
>
> Should custom tags "see" all scopes, or should they be passed in thru 
> the attributes? Should custom tags be treated the same as CFCs as far 
> as encapsulation goes?
>
> I'm just looking for other's experiences with this.
>
> Thanks
>
> -----Original Message-----
> From: Samuel Neff [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 29, 2003 4:19 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Display in CFCs
>
>
>
> I don't think there's anything wrong with doing display in a CFC as
> long
> as that's the whole point of the CFC.  Don't mix up database and
> business logic code with display code.  As long as you stick to that,
> where you put your display code (a custom tag or a cfc) makes no
> difference.
>
> Sam
>
>
> ----------------------------------------------
> Blog:  http://www.rewindlife.com
> Chart: http://www.blinex.com/products/charting
> ----------------------------------------------
>
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
>> Behalf Of Brad Howerter
>> Sent: Friday, August 29, 2003 5:06 PM
>> To: '[EMAIL PROTECTED]'
>> Subject: [CFCDev] Display in CFCs
>>
>> I'd like to have a religious war on whether to use CFCs or Custom 
>> Tags for display.  I tried to start one on CF-Talk a few weeks ago,
>> but it didn't get
>> much of a response.  I've never seen this fleshed out very
>> well anywhere.
>>
>> What are the reasons for NOT having methods that return HTML strings 
>> as a result?  All I ever read is "It's stupid" or "It's bad".  To
>> me it makes
>> sense to do it in a CFC as opposed to a tag, because then you
>> have self
>> documenting methods (instead of poorly documented tags).  And
>> I don't see a
>> downside to it.  If I have, say, a person object, why
>> shouldn't it know how
>> to display itself?  It's probably not as clean a solution as
>> having xml and
>> xslt, but to me it seems better than having a custom tag
>> displaying the
>> html.
>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[EMAIL PROTECTED]
>
>
Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com
(888) 408-0900 x901


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to