Adobe COLDFUSION 9 Manual page 184

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
Creating Flash Remoting elements
Adobe® Flash® applications that use Flash Remoting can easily take advantage of ColdFusion components for business
logic. In a CFC, the cffunction tag names the function and contains the application logic, and the cfreturn tag returns
the result to Flash.
Note: For ColdFusion component methods to communicate with Flash applications, set the
cffunction tag to remote.
For more information on creating CFCs for Flash Remoting, see
Using asynchronous CFCs
ColdFusion provides an event gateway that lets you send a message to a CFC asynchronously. This gateway lets you
initialize processing by a CFC without waiting for the CFC to complete or return a value. You can use asynchronous
CFCs that use this gateway for the following:
• Reindexing a Verity collection
• Logging information
• Running batch processes
For more information on using asynchronous CFCs, see
Creating ColdFusion components
When you create CFCs, you create methods, which are ColdFusion user-defined functions, in the component page.
You pass data to a method by using parameters. The method then performs the function and, if specified in the
tag, returns data.
cfreturn
You can also define variables in a CFC. Within a CFC, these variables are known as properties.
Tags for creating CFCs
You use the following tags to create a CFC. You include these tags on the CFML page that defines the CFC.
Tag
Description
cfcomponent
Contains a component definition; includes attributes for introspection. For more information, see
ColdFusion
cffunction
Defines a component method (function); includes attributes for introspection. For more information, see
"Defining component
cfargument
Defines a parameter (argument) to a method; includes attributes for introspection. For more information, see
"Defining and using method
cfproperty
Defines variables for CFCs that provide web services; also use to document component properties. For more
information, see
Elements of a CFC
A CFC has the following characteristics:
• It is a single CFML page with a .cfc filename extension. The component name is the same as the filename. For
example, if the file is myComponent.cfc, the component name is myComponent.
• The page is surrounded by a cfcomponent tag. No code can be outside this tag.
• The component page defines methods (functions), properties (data), or both. Most CFCs have methods, or
methods and properties, but you can also have a CFC that contains only properties.
"About event
components" on page 180.
methods" on page 180.
parameters" on page 183.
"The cfproperty
tag" on page 188.
Last updated 8/5/2010
access
"Using Flash with
CFCs" on page 616.
gateways" on page 1254.
179
attribute of the
"Building

Advertisement

Table of Contents
loading

Table of Contents