Adobe COLDFUSION 9 Manual page 154

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
Consider using UDFs in the following circumstances:
• You want to pass in arguments, process the results, and return a value. UDFs can return complex values, including
structures that contain multiple simple values.
• You want to provide logical units, such as data manipulation functions.
• Your code must be recursive.
• You distribute your code to others.
If you can create either a UDF or a custom CFML tag for a particular purpose, first consider creating a UDF because
running it requires less system overhead than using a custom tag.
For more information
For more information on user-defined functions, see
Using ColdFusion components
ColdFusion components (CFCs) are ColdFusion templates that contain related functions and arguments that each
function accepts. The CFC contains the CFML tags necessary to define its functions and arguments and return a value.
ColdFusion components are saved with a .cfc extension.
CFCs combine the power of objects with the simplicity of CFML. By combining related functions into a single unit,
they provide an object or class shell from which functions can be called.
ColdFusion components can make their data private, so that it is available to all functions (also called methods) in the
component, but not to any application that uses the component.
ColdFusion components have the following features:
• They are designed to provide related services in a single unit.
• They can provide web services and make them available over the Internet.
• They can provide ColdFusion services that Flash clients can call directly.
• They have several features that are familiar to object-oriented programmers, including data hiding, inheritance,
packages, and introspection.
Recommended uses
Consider using ColdFusion components when doing the following:
• Creating web services. (To create web services in ColdFusion, you must use components.)
• Creating services that are callable by Flash clients.
• Creating libraries of related functions, particularly if they must share data.
• Using integrated application security mechanisms based on roles and the requestor location.
• Developing code in an object-oriented manner, in which you use methods on objects and can create objects that
extend the features of existing objects.
For more information
For more information on using ColdFusion components, see
page 177
"Writing and Calling User-Defined
"Building and Using ColdFusion
Last updated 8/5/2010
Functions" on page 153.
Components" on
149

Advertisement

Table of Contents
loading

Table of Contents