AdobeStock_455007340

ColdFusion Functionality Exposed As Services

Home » ColdFusion Functionality Exposed As Services

Have you ever stopped to think about just how much functionality is baked into ColdFusion? We use to work with databases, allowing for highly flexible and dynamic SQL as well as query caching and more, and this is powered by a sophisticated internal engine. We use tags like and expect charts to be generated and displayed, without every really paying attention to the fact that an entire Java based charting engine is built in and actually doing the heavy lifting. The same is true for , , , support for SOAP and Web Services, XMPP and JMS integration, and so much more. While most of us focus on CFML the language, the truth is that the bulk of ColdFusion, the majority of what gets installed, is not the language but the extensive array of integrated services, services that are exposed to ColdFusion via CFML tags and functions.
But what if these services could be accessed outside of ColdFusion? If a PHP developer in the next cube over needed to merge PDF files, why couldn’t he invoke ColdFusion’s PDF manipulation services? If a .NET developer needed to access Microsoft Exchange, why couldn’t she use ColdFusion’s brilliant Exchange tags (rather than having to write lots and lots of .NET code, and I do mean lots and lots)? What about the Java developer who needs to easily manipulate spreadsheet files without tinkering with low level libraries?
And while we’re at it, what about the Flex developer who needs to generate an e-mail message? Flex (well, Flash) has no built in SMTP libraries, and so Flex developers who need to programmatically generate e-mail messages do so by writing code on the server. For ColdFusion developers this means creating a ColdFusion Component which accepts data from a Flex application (likely via an AMF call) and then passes that same data to a tag. In other words, code is being written on the server just to be able to pass data from Flex on the client to the tag. So why couldn’t a Flex developer just invoke directly, passing it name=value pairs so it can generate an e-mail?
Well, with the upcoming ColdFusion Centaur, the answer to all of these questions is yes, these are all doable! In ColdFusion Centaur we’re exposing lots of those integrated ColdFusion services via AMF (Flash Remoting) and SOAP (Web Services). The PHP, .NET, and Java developers can invoke ColdFusion built-in Web Services, pass in data, and get back results. And the Flex developer can include a ColdFusion SWC file exposing ActionScript classes and MXML tags via simple abstracted AMF calls. Simply include the SWC in your Flash Builder project, define the ColdFusion name space like this:

and you’ll have access to CFML tags within your Flex project. For example, to send an e-mail you could use the following:

The above code creates an instance of the Mail object and names it “cfMail”, and sets to, from, subject, etc., with the values of other Flex objects. To actually send the mail all you’d need is to invoke the following (possibly when a Send button is clicked):
cfMail.execute();
There is much more to this “ColdFusion as a Service” functionality, including lots more services exposed, and a sophisticated security model.
But the bottom line is that ColdFusion is now poised to become even more valuable to Flex and AIR developers, and now even of value to developers using other platforms and languages.

9 responses to “ColdFusion Functionality Exposed As Services”

  1. Adam Tuttle Avatar
    Adam Tuttle

    Peter Elst posted a video of Ryan Stewart demoing this new feature here: http://www.peterelst.com/blog/2009/06/11/sneak-peek-of-proxy-tags-in-coldfusion-9/
    Looks pretty awesome to me!

  2. James Lamar Avatar
    James Lamar

    I think this will really help to gain to support and usage of developers who feel more comfortable writing in other languages. Despite the fact that I love writing in CF I think this will be useful in projects where I’m forced to do ASP.NET or something other than CF.
    This is a great move by Adobe. It’s only going to attract more developers.
    Thanks for the insight Ben!

  3. Jared Rypka-Hauer Avatar
    Jared Rypka-Hauer

    And with that, a small legion of PHP, Python and Ruby devs all jumped from tall buildings into the killer earth below. Why? Well, mostly because there’s not even any *weak* arguments for why any of those are superior backend platforms for Flex or AIR apps. 😉

  4. andy matthews Avatar
    andy matthews

    Ben…Greg talked last night in Nashville about cfspreadsheet (which looks amazing by the way). Is there any thought about exposing this sort of functionality as a service as well? Or can a developer add this as a service on their own?

  5. Big Al Avatar
    Big Al

    Ben,
    Will this functionality be in the standard version? Or just enterprise?

  6. Ben Forta Avatar
    Ben Forta

    Andy, that’s still a work in progress.
    Big Al, no decisions about editioning have been made yet. But, I doubt that this would be enterprise only.
    — Ben

  7. Dan Avatar
    Dan

    Any idea if you could call CF tags as a service from inside a Visual Force page on the force.com platform?

  8. Govind Avatar
    Govind

    Where to do we get the SWC file?

  9. Ben Forta Avatar
    Ben Forta

    In a folder under CFIDE.
    — Ben

Leave a Reply