 |
Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.
July 9, 2009
Posted At : 10:43 AM
Related Categories:
ColdFusion :
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:
<cfset a=b=c=d=e=f=1>
-
Ternary operators are now supported:
<cfset a = (b < c) ? b : c>
-
In ColdFusion 8 we allowed you to create structures and arrays implicitly, like this:
<cfset struct={bold=TRUE, alignment="center"}>
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: <cfset struct={bold=TRUE, alignment="center"}> <cfset SpreadsheetFormatRow(sObj, struct, 1)>
This has been fixed in Cenatur, and the following will now work (as it should have before): <cfset SpreadsheetFormatRow(sObj, {bold=TRUE, alignment="center"}, 1)>
-
A new <CFCONTINUE> tag has been added, to complement the existing continue CFSCRIPT operator.
-
Support for "finally" has been added via a <CFFINALLY> 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 <CFDUMP>, WriteLog()is the equivalent of <CFLOG> (both of these are named similarly to the existing WriteOutput() function), Trace() is the equivalent of <CFTRACE>, Location() is the equivalent of <CFLOCATION>, and Throw() is the equivalent of <CFTHROW>.
-
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!
There are no trackbacks for this entry.
No trackback URL. Trackbacks are only allowed via interactive form.
|
|
--- Ben
--- Ben
Will that include the ability to invoke custom tags in CFSCRIPT?
For example:
<cfoutput query="returnsAQuery()"></cfoutput>
Instead of the current way:
<cfset myQuery = returnsAQuery() />
<cfoutput query="myQuery"></cfoutput>
Thanks
Marius
So why not Dump() and Output(), etc? Why the verbose addition of "write"?
Some of the tags for which script syntax is not supported - cfpop, cfimap, UI tags like cfgrid, etc.
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 projects is in having it all managed by the ORM. So, although I will upgrade to CF9 when it is released, I will not be using it for ORM. And this really disappoints me. I am just converting a windows app to a web/flex app using flex and cf. So, I guess I will have to look into using transfer - unless you have other suggestions. Also, it would seem to me that any medium sized application is likely to have multiple datasources, and therefore, is unlikely to use CF9 ORM until that feature is available. This is just my opinion. Thanks for any input you have.
It includes all available methods and variables, and is fully commented.