Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1190

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
Using CORBA interface methods in ColdFusion
When you use the cfobject tag or the CreateObject function to create a CORBA object, ColdFusion creates a handle to
a CORBA interface: the
cfobjectname
following CFML creates a handle named myHandle:
<cfobject action = "create" type = "CORBA" context = "IOR"
class = "d:\temp\tester.ior" name = "myHandle" locale="visibroker">
<cfset myHandle = CreateObject("CORBA", "d:\temp\tester.ior", "IOR", "visibroker")
You use the handle name to invoke all of the interface methods, as in the following CFML:
<cfset ret=myHandle.method(foo)>
Method name case considerations
Method names in IDL are case sensitive. However, ColdFusion is not case sensitive. Therefore, do not use methods
that differ only in case in IDL.
For example, the following IDL method declarations correspond to two different methods:
testCall(in string a); // method #1
TestCall(in string a); // method #2
However, ColdFusion cannot differentiate between the two methods. If you call either method, you cannot be sure
which of the two gets invoked.
Passing parameters by value (in parameters)
CORBA in parameters are always passed by value. When calling a CORBA method with a variable in ColdFusion,
specify the variable name without quotation marks, as shown in the following example:
IDL
void method(in string a);
CFML
<cfset foo="my string">
<cfset ret=handle.method(foo)>
Passing variables by reference (out and inout parameters)
CORBA out and inout parameters are always passed by reference. As a result, if the CORBA object modifies the value
of the variable that you pass when you invoke the method, your ColdFusion page gets the modified value.
To pass a parameter by reference in ColdFusion, specify the variable name in double-quotation marks in the CORBA
method. The following example shows an IDL line that defines a method with a string variable, b, that is passed in and
out of the method by reference. It also shows CFML that calls this method.
IDL
void method(in string a, inout string b);
CFML
<cfset foo = "My Initial String">
<cfset ret=handle.method(bar, "foo")>
<cfoutput>#foo#</cfoutput>
In this case, the ColdFusion variable foo corresponds to the inout parameter b. When the CFML executes, the
following happens:
1
ColdFusion calls the method, passing it the variable by reference.
The CORBA method replaces the value passed in, "My Initial String", with some other value. Because the variable
2
was passed by reference, this action modifies the value of the ColdFusion variable.
attribute or the
CreateObject
Last updated 1/20/2012
function return variable. For example, the
1185

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents