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 Building and Using ColdFusion Components


Get help faster and easier

New user?