In addition to all of the new features planned for ColdFusion Centaur, and the introduction of the new ColdFusion IDE, we’ve also managed to sneak in lots of smaller CFML enhancements, some of which are long overdue. Here are some of what we’ve been working on.

  • Assignments can now be chained, so this will work:
  • Ternary operators are now supported:
  • In ColdFusion 8 we allowed you to create structures and arrays implicitly, like this:

    The problem is that we didn’t quite finish the implementation, and so if you wanted to pass that structure to a tag or function you’d have needed to first save it to a temporary variable, like this:


    This has been fixed in Cenatur, and the following will now work (as it should have before):
  • A new tag has been added, to complement the existing continue CFSCRIPT operator.
  • Support for “finally” has been added via a tag and a finally operator.
  • One of the biggest CFML enhancement is in CFSCRIPT which now supports all of CFML (with minor exceptions where not appropriate). You can now build CFCs entirely in CFSCRIPT, including Application.cfc. You can invoke any tags and functions in CFSCRIPT. You can use new operators like abort, exit, include, and throw, to simplify your CFSCRIPT. In fact, you can now build a complete ColdFusion application entirely in CFSCRIPT, without using any CFML, if you are so inclined.
  • To make the CFSCRIPT enhancements work properly, we’ve also added a few new functions, WriteDump() is the equivalent of , WriteLog()is the equivalent of (both of these are named similarly to the existing WriteOutput() function), Trace() is the equivalent of , Location() is the equivalent of , and Throw() is the equivalent of .
  • ColdFusion variables (including complex types like arrays, structures, queries, CFCs, and Java objects) can be serialized to binary objects using the new SaveCFObject() function, and then deserialized later as needed using LoadCFObject(). These functions can work with variables as well as files, so objects can be serialized to disk and then read later when needed.

And we’re not done yet. Stay tuned, more cool stuff to follow!

28 thoughts

  1. Seconded about the ternary operator. I know the other changes are awesome, too, but I’ve been whining for a ternary operator for 10+ years.

  2. Awesome! Now if only a release date would be announced so that we can plan our overhaul w/ ORM integration accordingly…. We’re putting off the integration of Hibernate until CF9 comes out to prevent having to go backwards….

  3. This may not sit with others but I would like to see a new file extension for CFSCRIPT only files. Instead of having to use the CFSCRIPT tags to open and close the file, just name the file FILENAME.CFS or something like that. Not a major thing, just something I was thinking about.

  4. Russ, way back in CF5 days we talked about a CFS file, a file which was all CFSCRIPT and did not need the <CFSCRIPT> </CFSCRIPT> tags. Would be a bit trickier now, as we’d need two of those, one for .CFM files and one for .CFC files. But, still a worthy idea for a future enhancement.
    — Ben

  5. Are there plans to skip the "save to a variable" step for functions that return queries/arrarys?
    For example:
    <cfoutput query="returnsAQuery()"></cfoutput>
    Instead of the current way:
    <cfset myQuery = returnsAQuery() />
    <cfoutput query="myQuery"></cfoutput>

  6. Hi, Ben, still looking for something on SharePoint integration. It would be great to be able to read a SP entry (or a set, possibly a date range) out of SP instead of having to export SP records. Thanks.

  7. can you comment on any updates regarding exchange (availability of last datetime update of a record) and Sharepoint integration.
    Thanks
    Marius

  8. >>and Throw() is the equivalent of <CFTHROW>
    So why not Dump() and Output(), etc? Why the verbose addition of "write"?

  9. Hi Sean, custom tags are not supported in CFSCRIPT. Also, not all tags can be used in cfscript. We have added script support for most of the frequently used tags – cfquery, cftransaction, cflock, cfmail, cfthread, components, functions, cfthrow, cfrethrow, cffinally, cfexit, etc. Please refer the documentation for the whole list of attributes.
    Some of the tags for which script syntax is not supported – cfpop, cfimap, UI tags like cfgrid, etc.

  10. Does anyone know if there is support for connecting to more than one datasource in the CF9 ORM? I just read through the beta docs and I don’t see a way mentioned.

  11. Hi Randy, ColdFusion-ORM does not support multiple datasources. ColdFusion-ORM is designed to work with one datasource only, which you configure in Application.cfc (this.ormsettings.datasource=<datasourcename>).

  12. There had been a lot of discussions around supporting multiple datasources in Coldfusion-ORM all through the release. We had to make a trade-off between design-simplicity and supporting-multiple-datasources-per-application. We took the approach of keeping the design simple by supporting one-datasource-per-application. For applications which use multiple datasources, you could use the ORM approach for the primary datasource and revert back to the cfquery-based approach for the other datasources. Of-course let us know if you think otherwise.

  13. I was just looking at the cf9 docs and didn’t see any new functions for creating queries, nor is there one for creating new threads. Is the documentation 100% up to date, or is ORM the only way to access the DB via cfscript?

  14. @manjukiran,
    I appreciate the info. And I will admit that there is a lot to like and look forward to about CF9. And the ORM looks very promising. However, using an ORM for part of the data access is not a good idea. The benefit of medium to large proje

Leave a Reply