Adobe COLDFUSION 9 Manual page 686

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
You place the database manipulation functionality directly in the methods in the assembler CFC and create a Value
Object CFC, which is a CFC that contains property definitions and related
To separate the lower level database functionality from the high-level Flex assembler operations, you create a Data
Access Object (DAO) CFC that contains the lower level database functionality. Using this approach, which is the
Bean/DAO methodology, requires that you place the
methods in the assembler CFC call methods in the DAO CFC that perform the lower level database functions such as
retrieving records. The DAO CFC creates Value Objects, which are CFCs that contain the values. A Value Object is
essentially a row in the result set.
The LiveCycle Data Management Service recognizes the methods:
retrieves records from a database and populates an array with the records. The
The
method lets you keep track of synchronization conflicts by accepting a change list, which is an array of
sync
change objects. The
method returns a number that indicates how many records are in a result set. To perform
count
any of these database tasks, the Flex application calls the appropriate
assembler CFC. You can also use a
more information, see
"Managing
Creating the fill method
The
method retrieves records from a database and populates an array with the records. If you use the Bean/DAO
fill
methodology, you create the lower level
The
method returns the results of a read operation. In the
fill
of the read, and then return the results of the read operation. The essential elements of a
follows:
<cffunction name="fill" output="no" returntype="samples.contact.Contact[]" access="remote">
<cfreturn variables.dao.read()>
</cffunction>
You can return a Value Object CFC, a query, or an array of CFML structures. Using a query instead of a Value Object
CFC may improve performance. However, ColdFusion cannot handle nested results sets when you use a query. For
example, if one of the CFC properties you are returning from the
type such as another CFC type, ColdFusion cannot automatically convert a column in the query to an object with a
custom type. In this case, you return an array of CFCs, and the
constructs the correct object.
You can use structures wherever you currently create a ColdFusion component in the Assembler. However, you still
receive CFC Value Objects from Flex. For example, the Change Objects that you receive in the
CFCs, assuming that you have a remote alias defined in the ActionScript type.
You can create Value Object CFCs in the
return a structure instead of a CFC, because the structures are translated in the same way as CFCs. You can also return
an array of structures from the
your data and working with CFCs isn't fast enough. Generally, structures are faster than CFCs. You also use structures
when a member of the result object is a complex object. In this case, you create another structure as the value of that
key and provide the __type__ key for it.
You specify the returntype of the
1
Value Object:
<cffunction name="fill" output="no"
returntype="samples.contact.Contact[]" access="remote">
2
Query:
,
fill
method, which checks whether to update the results of a fill. For
fillContains
fills" on page 683.
method separately in the DAO CFC.
read
method. However, using the structure functionality, you can create and
get
method instead of an array of CFCs, for example, if you have to do processing on
fill
method as a Value Object CFC, a query, or an array:
fill
Last updated 8/5/2010
and
get
set
,
, and
methods in the assembler CFC. The
get
sync
count
,
,
, and
fill
get
sync
method retrieves a specific record.
get
,
,
, or
fill
get
sync
method, you create an array to hold the results
fill
method was populated with another complex
fill
method or the
fill
read
methods.
. The
method
count
fill
method in the
count
method appear as
fill
method in the DAO CFC
method contain
sync
681

Advertisement

Table of Contents
loading

Table of Contents