Recommended Uses; For More Information; Using Coldfusion Components; Creating And Using Coldfusion Components - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Recommended uses

CFX tags provide one way of using C++ or Java code. However, you can also create Java classes
and COM objects and access them using the
built-in features that the
CFX tags are easier to call in CFML code. You use CFX tags directly in CFML code as you
would any other tag, and you can pass arguments using a standard tag format.
ColdFusion provides predefined classes for use in your Java or C++ code that facilitate CFX tag
development. These classes include support for request handling, error reporting, and query
management.
You should consider using CFX tags in the following circumstances:
You already have existing application functionality written in C++ or Java that you want to
incorporate into your ColdFusion application.
You cannot build the functionality you need using ColdFusion elements.
You want to provide the new functionality in a tag format, as opposed to using the
tag to import native Java or COM objects.
You want use the Java and C++ classes provided by ColdFusion for developing your CFX code.

For more information

For more information on CFX tags, see
on page
251.

Using ColdFusion components

Unlike other Coldfusion reusable elements, ColdFusion components encapsulate multiple,
related, functions. A ColdFusion component is essentially a set of related UDFs and variables, with
additional functionality to provide and control access to the component contents. 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 Macromedia Flash clients can call directly.
They have several features that are familiar to object-oriented programmers including data
hiding, inheritance, packages, and introspection.

Creating and using ColdFusion components

Creating and using a component is more complex than creating and using a user-defined function
(UDF). For example, you specify a component and one or more functions. You can invoke
ColdFusion components in many ways, including using the
can also use forms, URLs, and the Flash client-side ActionScript.
To invoke a component method with a
<cfinvoke component="componentName" method="methodName"
returnVariable="variableName" argumentCollection="argumentStruct">
170
Chapter 8: Reusing Code in ColdFusion Pages
cfobject
tag does not have:
cfobject
Chapter 12, "Building Custom CFXAPI Tags,"
cfinvoke
tag. CFX tags, however, provide some
and
cfinvoke
tag, use code such as the following:
cfobject
tags. You
cfobject

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents