Adobe COLDFUSION 9 Manual page 195

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
You can create persistent CFCs by assigning the CFC instance to a persistent scope, such as the Session or Application
scope. This way, you can create CFCs for objects, such as shopping carts or logged-in users, that must persist for
sessions. You can also create CFCs that provide application-specific data and methods.
Tags for using CFCs
The following table lists the tags that you use to instantiate or invoke a CFC. You use these tags on the CFML page on
which you instantiate or invoke the CFC.
Tag
cfinvoke
cfinvokeargument
cfobject
CreateObject
CFC invocation techniques
ColdFusion provides many ways to instantiate CFCs and invoke CFC methods. The following table lists the
techniques, including the ColdFusion tags and functions that you use:
Invocation
cfinvoke tag
cfset tag and assignment
statements
URL (HTTP GET)
Form control(HTTP POST)
Flash Remoting
Web services
Instantiating CFCs
If you use a CFC multiple times in a ColdFusion request, or if you use a CFC with persistent properties, use the cfobject
tag or CreateObject function to instantiate the CFC before you call its methods.
The following example uses the
<cfobject component="tellTime" name="tellTimeObj">
The following example uses the
tellTimeObj = CreateObject("component", "tellTime");
Description
Invokes a method of a CFC.
Passes the name and value of a parameter to a component method.
Creates a CFC instance.
Creates a CFC instance.
Description
Invokes a component method. Can invoke
methods of a CFC instance or invoke the
methods transiently.
Invoke methods and access properties of a
component instance.
Transiently invokes a component method by
specifying the component and method names
in the URL string.
Transiently invokes a component method using
the HTML
form
and
input
tags and their
attributes.
ActionScript can transiently invoke component
methods.
The
cfinvoke
tag and CFScript consume web
services in ColdFusion. External applications can
also consume CFC methods as web services.
tag to create an instance of the tellTime CFC.
cfobject
function to instantiate the same component in CFScript:
CreateObject
Last updated 8/5/2010
For more information
See
"Invoking CFC methods with the cfinvoke
page 191.
See
"Using components directly in CFScript and
on page 193.
See
"Invoking component methods by using a
page 194.
See
"Invoking component methods by using a
page 194.
See
"Using the Flash Remoting
Service" on page 606.
See
"Using Web
Services" on page 1093.
190
tag" on
CFML"
URL" on
form" on

Advertisement

Table of Contents
loading

Table of Contents