Saturday, March 20, 2010    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Jul 2009 >>
S M T W T F S
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Search

Categories
 • Acrobat (3) [RSS]
 • Adobe (90) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (66) [RSS]
 • AdobeMAX09 (39) [RSS]
 • AdobeMAX10 (1) [RSS]
 • AIR (219) [RSS]
 • Appearances (191) [RSS]
 • Books (72) [RSS]
 • CFEclipse (15) [RSS]
 • ColdFusion (1381) [RSS]
 • Data Services (34) [RSS]
 • Fish Tank (5) [RSS]
 • Flash (197) [RSS]
 • Flex (498) [RSS]
 • Home Automation (5) [RSS]
 • Jobs (116) [RSS]
 • JRun (14) [RSS]
 • Labs (43) [RSS]
 • LiveCycle (34) [RSS]
 • MAX (232) [RSS]
 • Mobile (120) [RSS]
 • Regular Expressions (17) [RSS]
 • RIA (21) [RSS]
 • SQL (40) [RSS]
 • Stuff (536) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (162) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • Mark Doherty
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

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.

Viewing By Entry / Main
July 9, 2009

CFML Enhancements Coming Soon

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!

TrackBacks
There are no trackbacks for this entry.

No trackback URL. Trackbacks are only allowed via interactive form.

Comments
The ternary operator makes me smile, Ben.
# Posted By Lionhart | 7/9/09 11:12 AM
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.
# Posted By Rick O | 7/9/09 11:17 AM
So what have these guys been doing with all the spare time they have on their hands Ben?
# Posted By TJ Downes | 7/9/09 11:22 AM
Do you think a CFSCRIPT version of CFQUERY will makes it way in?
# Posted By Jared Shields | 7/9/09 11:44 AM
Jared, yes, it will.

--- Ben
# Posted By Ben Forta | 7/9/09 11:54 AM
I am interested in seeing an application.cfc written entirely in cfscript.
# Posted By Tony | 7/9/09 12:03 PM
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....
# Posted By Jared Shields | 7/9/09 12:03 PM
Its great to see these subtleties being included in the new release along with important features like <cffinally>.
# Posted By JAlpino | 7/9/09 12:38 PM
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.
# Posted By Russ Johnson | 7/9/09 12:38 PM
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
# Posted By Ben Forta | 7/9/09 12:47 PM
Thanks for the updates. What will the CFSCRIPT version of <cfquery /> look like?
# Posted By Ciaran A | 7/9/09 1:30 PM
"You can invoke any tags and functions in CFSCRIPT."

Will that include the ability to invoke custom tags in CFSCRIPT?
# Posted By Sean Corfield | 7/9/09 1:49 PM
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>
# Posted By Bradley Moore | 7/9/09 2:51 PM
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.
# Posted By Joe Meboe | 7/9/09 11:34 PM
Russ, For CFCs that are written in cfscript style, you do not need to write <cfscript>. You just write it in the cfscript syntax.
# Posted By Rupesh Kumar | 7/10/09 3:35 AM
I can't wait for SaveCFObject()!!!
# Posted By Anthony | 7/10/09 11:19 AM
can you comment on any updates regarding exchange (availability of last datetime update of a record) and Sharepoint integration.

Thanks
Marius
# Posted By Marius M | 7/10/09 11:34 AM
>>and Throw() is the equivalent of <CFTHROW>

So why not Dump() and Output(), etc? Why the verbose addition of "write"?
# Posted By ziggy | 7/11/09 2:10 AM
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.
# Posted By Manjukiran | 7/13/09 2:09 AM
@MJ, thanx for the clarification. I'm just looking at the CF9 Public Beta docs now to see what you guys decided to support in the end. Great work!
# Posted By Sean Corfield | 7/13/09 2:56 AM
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.
# Posted By Randy Leinen | 7/13/09 2:26 PM
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>).
# Posted By Manjukiran | 7/13/09 2:31 PM
So then, if my application has multiple datasources then I cannot use the new ORM in CF9?
# Posted By Randy Leinen | 7/13/09 2:34 PM
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.
# Posted By Manjukiran | 7/13/09 3:14 PM
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?
# Posted By adam j. sontag | 7/13/09 3:52 PM
@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 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.
# Posted By Randy Leinen | 7/13/09 4:17 PM
I've written a complete Application.cfc reference in CFScript for Coldfusion 9. You can see it here: http://cfruss.blogspot.com/2009/11/applicationcfc-...
It includes all available methods and variables, and is fully commented.
# Posted By Russ S. | 12/12/09 5:03 AM
Forgot to include the link to my Application.cfc reference: http://cfruss.blogspot.com/2009/11/applicationcfc-...
# Posted By Russ S. | 12/12/09 5:05 AM

  © Copyright 1997-2009 Ben Forta, All Rights Reserved