Likewise this works fine for me. I still seperate the logic from display. I have two cfc's one that contains database logic and the other contains display logic. So considering your poll example I have a modPoll.cfc and a viewPoll.cfc
---------- Original Message ---------------------------------- From: "Paul Vernon" <[EMAIL PROTECTED]> Reply-To: cf-talk@houseoffusion.com Date: Thu, 8 Mar 2007 12:40:30 -0000 > >> 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? > >I think there are always exceptions to the rule on this, in our e-Commerce >system, there are several places where I would want to render a shopping >basket and I need to render it in both HTML and text only versions. If I >were to do these sections of code outside of the CFC's then it would be a >nightmare however, having a couple of functions in the basket CFC to >renderHTMLBasket and renderTEXTBasket means that I have complete consistency >across the site and I only have to bug fix/maintain a couple of functions. > >What those functions *don't* do is output any HTML or TEXT direct to the >calling page, instead, I use <cfsavecontent and return the generated content >from the functions as a string. That way, I am still keeping the CFC's away >from direct interaction with the pages but I am generating a small amount of >content using those same CFC's. > >HTH > >Paul > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:272001 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4