Application development and deployment process
43
Selecting a methodology
When you create your ColdFusion CFCs, you can put 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
get
and
set
methods.
However, to separate the lower level database functionality from the high level Flex assembler
operations, you can use the Bean/DAO methodology.
The Bean/DAO methodology requires that you put the
fill
,
get
,
sync
, and
count
methods
in the assembler CFC. Rather than performing database functions directly, such as retrieving
data, the methods in the assembler CFC call methods in the Data Access Object (DAO)
CFC, which 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.
Managing fills
To determine whether to refresh a fill result after an item is created or updated, you include a
fillContains
method in the assembler and set both use-fill-contains and auto-refresh to true
in the
<fill-method
> section of the data-management-config.xml file. A sample
<fill-
method>
section appears as follows:
<fill-method>
<use-fill-contains>true</use-fill-contains>
<auto-refresh>true</auto-refresh>
<ordered>false</ordered>
</fill-method>
In this example, ordered is set to false because the fill result is not sorted by any criteria.
However, if the fill result is sorted, you set ordered to true. When an item changes in a fill
result that is ordered, you must refresh the entire fill result.
The
fillContains
method tells the Flex application whether it is necessary to run the fill
again after an item in the fill result has changed. The
fillCcontains
method returns a value
that indicates how the fill should be treated for that change. When the
fillContains
method returns true, the fill is executed after a create or update operation.
The
fillContains
method signature is as follows:
<cffunction name="fillContains" output="no" returnType="boolean"
access="remote">
<cfargument name="fillArgs" type="array" required="yes">
<cfargument name="item" type="[CFC type object]" required="yes">
<cfargument name="isCreate" type="boolean" required="yes">
Содержание COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX...
Страница 1: ...Using ColdFusion MX with Flex 2...
Страница 12: ...12 Using Flash Remoting Update...
Страница 24: ...24 Using the Flex Messaging Event Gateway...
Страница 71: ...Example application 71 wait png The wait png file appears as follows...
Страница 72: ...72 Using the Flex Data Service Assembler...