Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1168

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Disabling automatic conversion of complex .NET data
You can disable automatic conversion of .NET
System.Collections.ArrayList
array, or query objects. You could want to disable the conversion under the following circumstances:
• If a collection or DataTable returned by a .NET method is large and you only want a small subset of the data. If auto
conversion is enabled, ColdFusion creates a data structure with all the object's fields. Creating the structure could
take significant time and resources, because ColdFusion must invoke .NET methods internally to get each of the
fields. You can disable the automatic conversion and retrieve the fields or data from .NET objects like any other
objects.
• If you invoke a .NET method that returns a complex variable, and then pass the variable to another .NET method
as argument. If automatic conversion is enabled, you cannot pass the Hashtable object from the first method
directly to the second method.
To disable automatic conversion, set the JVM coldfusion.dotnet.disableautoconversion system property to true. For
example, in a ColdFusion stand-alone server, or if you use JRun as your J2EE server, include the following setting in
the JVM.config file:
-Dcoldfusion.dotnet.disableautoconversion=true
Manually converting complex .NET objects
Use the
function to convert a
DotNetToCFType
System.Collections.ArrayList
respectively when either of the following circumstances are true:
• You have set the coldfusion.dotnet.disableautoconversion system property to true.
• Automatic conversion is enabled, you created the complex .NET object by using the
tag, and you want to convert this object into the corresponding ColdFusion representation.
cfobject
For an example of using the function, see DotNetToCFType in the CFML Reference.
Using .NET objects
.NET fields and return values with class types are available in ColdFusion as .NET objects. You can use the object's
methods to access object data and make it available to ColdFusion using supported data types.
The following example gets information about a system's drives. It calls the System.IO.DriveInfo.GetDrives() method
to get an array of System.IO.DriveInfo objects, one per drive. It then calls the object methods to get specific
information about the drives, and displays the information. The example uses a
Note: The System.IO.DriveInfo is not included in the .NET 1.x framework. It is included in .NET 2.0 and later
frameworks. For information on determining the .NET framework, see
page 1170.
System.Collections.Hashtable
or S
ystem.Data.DataTable
System.Collections.Hashtable
or S
ystem.Data.DataTable
Last updated 1/20/2012
,
objects to the corresponding ColdFusion structure,
,
object to a ColdFusion structure, array, or query
createObject
tag to simplify the code.
cfdump
"Determining and changing the .NET
1163
function or
version" on

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents