Conduit

PDF HTML FlashPaper

Differences between Conduit and ColdFusion remoting

The following aspects are bug fixes / enhancements that Conduit provides over the current ColdFusion Remoting platform.

This covers the core Invoker/Serialiser/Deserialiser set, and can be changed with custom code.

Bug Fixes

Cyclic Object Graphs Bug

ColdFusion Remoting has a bug where it manages cyclic object graphs very badly. See this blog post for more details.

BlazeDS resolves this issue, and therefore Conduit does as well.

Limitations

Application.cfc

Currently, Conduit has no support for Application.cfm (although there is no reason why it couldn't be implemented). Conduit will search for Application.cfc's in the root of any CFC's that are invoked via RemoteObject. This includes CFCs that are invoked from a mapped directory.

Enhancements

Increased Logging

No more failing silently! If something goes wrong within Conduit, or it needs to make a decision, it will tell Log it or error out.

See Debugging with Conduit on how to turn on 'Info' level logging.

<CFCOMPONENT > Enhancements

remoteScope="application"

When Remoting in ColdFusion, any CFC that is invoked by Flex via RemoteObject is recreated in every request. In Conduit, you are able to persist the CFCs that are invoked by a Flex RemoteObject call, in the application, session, or server scope.

To do this, simple add a remoteScope attribute to the <cfcomponent> tag of the CFC being invoked, with the name of the scope you wish to persist the CFC in.

For example:

<cfcomponent hint="proxy stored in a share scope" output="false" remoteScope="session"> <cfscript> instance.value = 1; </cfscript> <cffunction name="getIncrementingValue" hint="returns a value, and increments it by 1" access="remote" returntype="numeric" output="false"> <cfreturn instance.value++ /> </cffunction> </cfcomponent>

Is stored in the session scope, and has a value within it incremented by 1, every time getIncrementingValue() is invoked.

<CFPROPERTY> Enhancements

nullvalue="0"

When Remoting encounters a set() method matching to CFProperty, when moving AS3 objects to CFC, if the AS3 value is 'null', then the CF remoting attempts to insert NULL into the set() method on the CF side. This can often error, as CF code rarely handles 'null' values very well, and results in the setter simply being skipped over.

In Conduit, you are able to specify a nullvalue you wish to be passed instead, when AS3 objects convert => CFCs, and also when CFCs => AS3 objects.

For example:

<cfproperty name="myString" type="string" nullvalue="" /> <cffunction name="getMyString" access="public" returntype="string" output="false"> <cfreturn instance.myString /> </cffunction> <cffunction name="setMyString" access="public" returntype="void" output="false"> <cfargument name="myString" type="string" required="true"> <cfset instance.myString = arguments.myString /> </cffunction>

If the AS3 object's property 'myString' is null, this will be converted to being called as setMyString("") when pushing data from AS3=>CFC. Conversely, when going CFC=>AS3 Object, if the getString() equals "", then the AS3 object's 'myString' property will be converted to 'null'

This gives you a convenient way to manage null values as they pass from CFCs => AS3 and back.

nullMethod="removeFoo"

Similarly with nullValue, this is a way to manage 'null' values as they come from Flex into CF. If a <cfproperty> has the attribute of nullmethod set, Conduit will attempt to call this method, rather than set the value to being 'null'. This can be useful when managing compositions of objects.

For example:

<cfproperty name="simple" type="tests.cfml.cfc.model.Simple" nullmethod="removeSimple"> <cffunction name="setSimple" access="public" returntype="void" output="false"> <cfargument name="Simple" type="Simple" required="true"> <cfset instance.Simple = arguments.Simple /> </cffunction> <cffunction name="removeSimple" hint="remove simple" access="public" returntype="void" output="false"> <cfset StructDelete(instance, "Simple") /> </cffunction>

Will have the function 'removeSimple', if the value of 'simple' on the AS3 Object has a value of 'null', when passed back to ColdFusion.

remoteset="true|false

This is a way in which to ensure that values coming from a Flex VO, are not set on your object. If the remoteset attribute is set to false, then incoming data from Flex will not be set on the given property.

For example:

<cfproperty name="id" type="uuid" remoteset="false">

In this instance, this property represent the ID of the object, we do not wish for it to be reset by Flex, in case it gets set to an invalid value.

Defaults to 'true'

remoteget="true|false

Similar to remoteset, the remoteget attribute controls whether or not the given property value is sent up to the accompanying Flex VO or not.

For example:

<cfproperty name="clientID" type="String" remoteget="false">

In this sitution, we may have a Flex client side variable in which we do not wish to ever override from the ColdFusion Server, but wish to recieve to the ColdFusion server. So in this case, the 'clientID' property will never be sent up to a Flex VO.

Defaults to 'true'.