Instantiating Cfcs; Cfc Invocation Techniques - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

If you invoke a CFC method remotely, using a specific URL, form field, Flash Remoting MX,
or a web service invocation, ColdFusion looks in the specified path relative to the web root.
For form fields and URLs specified directly on local web pages, ColdFusion also searches
relative to the page directory.
Note: On UNIX and Linux systems, ColdFusion MX attempts to match a CFC name or Custom tag
name with a filename as follows: First, it attempts to find a file with the name that is all lowercase. If it
fails, it then tries to find a file whose case matches the CFML case. For example, if you specify
<cfobject name="myObject" Component="myComponent">
mycomponent.cfc and, if it doesn't find it, ColdFusion looks for myComponent.cfc.

Instantiating CFCs

If you use a CFC multiple times in a ColdFusion request, or if you use a CFC with persistent
properties, use the
call its methods.
The following example uses the
<cfobject component="tellTime" name="tellTimeComp">
The following example uses the
tellTimeComp = CreateObject("component", "tellTime");

CFC invocation techniques

There are many ways to invoke or call CFC methods. The following table lists the techniques,
including the ColdFusion tags and functions that you use:
Invocation
cfinvoke
tag
tag and
cfset
assignment
statements
URL
(HTTP GET)
Form control
(HTTP POST)
Flash Remoting NetServices ActionScript functions can
Web services
tag or
cfobject
CreateObject
cfobject
cfobject
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.
transiently invoke component methods.
The cfinvoke tag and CFScript consume
web services in ColdFusion MX. External
applications can also consume CFC
methods as web services.
, ColdFusion first looks for
function to instantiate the CFC before you
tag to create an instance of the tellTime CFC.
tag to instantiate the same component in CFScript:
For more information
See
the cfinvoke tag" on page
See
CFScript and CFML" on page
See
using a URL" on page
See
using a form" on page
See
Remoting Service," on page
See
Services," on page
Using ColdFusion components
"Invoking CFC methods with
226.
"Using components directly in
"Invoking component methods
230.
"Invoking component methods
231.
Chapter 29, "Using the Flash
Chapter 32, "Using Web
707.
229.
641.
225

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents