View comments | RSS feed

Selecting among ColdFusion code reuse methods

The following table lists common reasons to employ code reuse methods and indicates the techniques to consider for each purpose. The letter P indicates that the method is preferred. (There can be more than one preferred method.) The letter A means that the method provides an alternative that might be useful in some circumstances.

This table does not include CFX tags. You use CFX tags only when you should code your functionality in C++ or Java. For more information about using CFX tags, see "Using CFX tags".

Purpose
cfinclude
tag
Custom tag

UDF

Component
Provide code, including CFML, HTML, and static text, that must be used in multiple pages.
P



Deploy headers and footers.
P



Include one page in another page.
P



Divide pages into smaller units.
P



Use variables from a calling page.
A
P
P

Implement code that uses recursion.

P
P
P
Distribute your code to others.

P
P
P
Operate on a body of HTML or CFML text.

P


Use subtags.

P


Provide a computation, data manipulation, or other procedure.

A
P

Provide a single functional element that takes any number of input values and returns a (possibly complex) result.

A
P

Use variables, whose variable names might change from use to use.

A
P
P
Provide accessibility from Flash clients.

A
A
P
Use built-in user security features.


A
P
Encapsulate multiple related functions and properties.



P
Create web services.



P
Implement object-oriented coding methodologies.



P

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


carehart@systemanage said on Jan 3, 2003 at 9:52 AM :
Regarding the statement:

"If you can create either a UDF or a custom CFML tag for a particular purpose, first consider creating a UDF because invoking it requires less system overhead than using a custom tag."

While that was conventional wisdom in CF 5, hasn't it been demonstrated that there is neglible performance difference between UDFs and custom tags (and CFINCLUDE, yadda yadda yadda) in CFMX?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/reuseIntro8.htm