----- Original Message ----- From: "Cutter - (CFTalk List)" <[EMAIL PROTECTED]> > We are using mostly CF 4.5, with one 5.0 server and several CFMX servers on > the way. For now though the question is, which is the best, most productive, > lowest load and overhead method to use for reusable application code? There > is some debate here as to the viability of using custom cf tags instead of > implementing them as modules (or, in some cases, as includes). ----------------------------
First off, "modules" and "cf tags" are the same things. A CF custom tag is just a .cfm file that encapsulates certain functionality, and is called using either: <cf_nameOfFile attribute="value"> OR <cfmodule template="[path to file]/nameOfFile.cfm" attribute="value"> Includes are obviously included using <cfinclude template="[path to file]/nameOfFile.cfm">, but they can't accept attributes like custom tags. Includes are quicker cos the server doesn't have to initiate the whole custom tag process that makes the tag a "black box" - ideally, you pass attributes in to a custom tag and it returns values via the Caller scope. If you include a file, it's as if the code in the include file is just there in the template that included it - just a quick way of re-using code. When you call a custom tag, the server's processing the code in the tag in a slightly separate "space" (it can still access scopes such as URL, Form, Request, etc., but not variables local to the calling page). I do currently have custom tags that *usually* work with certain variables (e.g. form input or a query object in the Request scope). So, if attributes.query doesn't exist, I set it to request.existingQuery. Then, for 90% of its use, I can just CFINCLUDE it after request.existingQuery is created. In exceptional cases, where I need it to use something other than request.existingQuery, I pass in the right query as an attribute. This probably saves some server time, but it's not to great for real modularity, extensibility and portability. I'm using my transition to CFMX to rectify this :-) HTH, Gyrus [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://www.norlonto.net PGP key available ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.

