Aug 30

ActionScript ColdFusion variable translation

Posted by James Netherton | Thursday 30 August 2007 0:08 AM | In Flex

Thought I would post this as I can never track down this information via livedocs.

Here’s what data type ColdFusion variables get converted to in ActionScript when making remote calls to CF services:

ColdFusion data type      ActionScript data type
String String
Array Array
Struct Untyped Object
Query Array of untyped Objects
CFC Class typed Object
CFC Date ActionScript Date
CFC String ActionScript String
CFC Numeric ActionScript Numeric
ColdFusion XML Object ActionScript XML Object

Aug 29

Fusion Authority Scotch On The Rocks reviews

Posted by James Netherton | Wednesday 29 August 2007 7:08 AM | In ColdFusion

Two of my colleagues David Beale and Kola Oyedeji have recently posted their round-up of events at the Scotch On The Rocks ColdFusion conference.

Check them out:

A Review of Scotch on the Rocks 2007


A Tale of CFML, Flex and a Pineapple

Aug 10

Change to services-config.xml in ColdFusion 8

Posted by James Netherton | Friday 10 August 2007 9:08 AM | In Flex

I’m not sure whether this changed in the ColdFusion 8 release candidate or in the final release…..

A subtle change has been made to services-config.xml from the format that has been used since ColdFusion 7.0.2 and through the ColdFusion 8 beta releases.

The Flash Remoting definition for ColdFusion has been moved out of services-config.xml to a separate XML file named remoting-config.xml.

Something to be aware of if you’re writing applications that aren’t using their own individual config files.

Aug 08

Using CFCOMPILE within Eclipse

Posted by James Netherton | Wednesday 08 August 2007 8:08 AM | In ColdFusion

Recently I’ve been working on a Flex project and have been doing some tinkering with Java. Both languages require you to compile source code in order to execute the target application. After doing some refactoring within the Flex application, it struck me just how much the compiler helps you to scoop up any mistakes that may have been made along the way.

For example, I could change a variable to be of a different class type and the compiler would then list all of the locations where any references to that variable became invalid. It’s then just a case of clicking through the errors in the Eclipse problem view and making any appropriate fixes.

I guess this is only helpful for small to medium refactorings. Refactoring on a larger scale you’d ideally want to use a refactoring tool which thankfully Java and Flex 3 have within Eclipse.

It got me thinking though. Seeing as there is no refactoring tool for ColdFusion, would compiling the source code before attempting to run an application, help with fixing bugs and trapping any mistakes that may have been made?

If you don’t already know, you can use the cfcompile utility to compile ColdFusion applications into java .class files. If errors are encountered within any source files, they are output in the form of stack traces and in the usual ColdFusion style of “Error x occurred in y file at z location”.

I decided to investigate whether I could make use of cfcompile through Eclipse. It’s actually quite easy, although not an ideal solution, which I’ll elaborate on later.

From the main menu bar choose:

Run :: External Tools :: External Tools

A new window should open listing the external tools that are currently configured in Eclipse. One of the options should be titled ‘program’. Right click on the icon and choose ‘new’.

Give the configuration a meaningful descriptive name like ‘Compile ColdFusion Code’. Then within the ‘location’ field, enter the full path to the cfcompile .bat or .sh script. For Mac and ‘nix users running the ColdFusion J2EE configuration, there’s some additional work in order to get CFCOMPILE working. Read all about it here.

Finally click the ‘Variables’ button. From the list of variables choose ${file_loc}. Click the ‘Apply’ button and everything should be configured and ready to go!

Select a project or an individual .cfm / .cfc file within your Eclipse resource navigator and from the toolbar area select the ‘Run External Tool’ icon, which looks like the image below. Then choose the ‘Compile ColdFusion Code’ option.

If everything works correctly, you should see Eclipse launch the console view. Within the console should be the compilation results. Any errors will appear in red.

As I mentioned earlier, all of this isn’t ideal. What would be nicer is if you could click through each error via the ‘Problems’ view.

What do people think? Would this make your ColdFusion application development and debugging easier in any way?

Aug 02

Lots of reading to do…

Posted by James Netherton | Thursday 02 August 2007 15:08 PM | In Blogging

I added a few titles to my book collection today:

Domain Driven Design

Patterns of Enterprise Application Architecture

Refactoring to Patterns

Beautiful Code

Once I’ve finished with Fowler’s Refactoring, I’ll make a start :-)