User Guide

Table Of Contents
30 Chapter 2: Elements of CFML
Using external tools and objects, including Verity collections, COM, Java, and CORBA
objects, and executable programs
Using protocols, such as mail, http, ftp, and pop
Much of this document describes how to use these tags effectively. CFML Reference documents
each tag in detail.
Custom tags
ColdFusion lets you create custom tags. You can create two types of custom tags:
CFML custom tags that are ColdFusion pages
CFX tags that you write in a programing language such as Java or C++
Custom tags can encapsulate frequently used business logic or display code. These tags enable you
to place frequently used code in one place and call it from many places. Custom tags also let you
abstract complex logic into a single, simple interface. They provide an easy way to distribute your
code to others; you can even distribute encrypted versions of the tags to prevent access to the tag
logic.
You can access a variety of free and commercial custom tags on the Macromedia developers
exchange (www.macromedia.com/cfusion/exchange/index.cfm). They perform tasks ranging
from checking if Cookies and JavaScript are enabled on the client's browser to moving items from
one list box to another. Many of these tags are free and include source code.
CFML custom tags
When you write a custom tag in CFML, you can take advantage of all the features of the
ColdFusion language, including all built-in tags and even other custom tags. CFML custom tags
can include body sections and end tags. Because they are written in CFML, you do not need to
know a programming language such as Java. CFML custom tags provide more capabilities than
user-defined functions, but are less efficient.
For more information on CFML custom tags, see Chapter 11, “Creating and Using Custom
CFML Tags,” on page 241. For information about, and comparisons among, ways to reuse
ColdFusion code, including CFML custom tags, user-defined functions, and CFX tags, see
Chapter 8, “Creating ColdFusion Elements,” on page 161.
CFX Tags
CFX tags are ColdFusion custom tags that you write in a programming language such as Java or
C++. These tags can take full advantage of all the tools and resources provided by these languages,
including their access to runtime environments. CFX tags also generally execute faster than
CFML custom tags because they are compiled. CFX tags can be cross-platform, but are often
platform-specific, for example if they take advantage of COM objects or the Windows API.
For more information on CFX tags, see Chapter 12, “Building Custom CFXAPI Tags,” on
page 259.