This is not a rule of CFCs, just a 'suggestion' from some of the people using 
them. There logic is to separate the logic of an application from its 
presentation. This allows for easy change of the presentation without touching 
the logic. The argument is logical, but not necessarily the rule. 

I ignore it when logic dictates that it should be ignored. For example, I have 
a single comment component that has all of the code and display to handle a 
comment. I see no reason to have the display in another template and if someone 
else was using the component and wanted a different display, they could just 
inherit my component and change the display method. But that might be 
considered bad OOP, which is an argument I also ignore when logic dictates.

If you find that you have a reason to include display in the same component as 
logic, pay particular attention to the output attribute and what it does. 

> Thing is I know I'm not supposed to put any presentation stuff in them. 
> But say for example I had a poll cfc. I can run all of the actions 
> through the CFC fine, but why not add some optional basic html (i.e. 
> form & results) so that if wanted, the whole poll could be 
> encapsulated within the one file and in theory could be added to any 
> site with just a couple of lines of code. If the basic form & results 
> didn't suit I could then go for a tailored option for the sites that 
> needed it but all would still be based on the one cfc. 
> 
> So would this a bad thing and why?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271994
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to