ColdFISH 3.0 Alpha Released

You may not know what ColdFISH is, but if you are running BlogCFC then you are using it, and chances are at the minimum that you've read a blog that does use it. Well, I've been doing some work on ColdFish due to several requests. This latest version includes:

  • XML based configuration - no need to get into the code to change a color or add a keyword
  • Keyword formatting for CFML, CFSCRIPT, ActionScript, and SQL!!!
  • The ability to tell the parser you are just looking for just SQL, CFScript, or ActionScript (it can't guess script based languages... it does figure out tag-based on its own)
  • Caching of formatted code blocks (once it's been parsed it will stay in memory until it hits the cache limit, cache size is configurable)
  • A toolbar that allows for viewing the code as plain text, copying it straight to the clipboard, or even sending just the block straight to a printer
  • A cleaner default look and feel

If you're interested in testing the alpha out you can check it out of the subversion repository at http://svn.riaforge.org/coldfish/. Feedback is very welcome!

If you just want to learn more about ColdFish, check out the project at http://coldfish.riaforge.org/

Have a great New Years! Jason

10 Things ColdFusion 10 Really NEEDS

I was reading a ColdFusion 10 Wish List today (I am behind on my blog reading) and it is largely filled with minor tweaks that are a bit too myopic for me. I think Server-side Actionscript is interesting, particularly to Flex developers looking for a back-end, but almost everything else on the list struck me as missing a broader view.

From the general list there are things like incorporating Omniture (a web analytics tool), adding message queuing (I assume this is essentially incorporating JMS directly into the language. By the way, you can do this today with the JMS Gateway), calling a CFC from Java(CFCProxy already exists too), queryparam for LDAP, multiple datasources for ORM, and NTLM support.

Really??? This is what we want for ColdFusion 10!?!

Well I want more from Adobe than that. I know we are all still catching up to ColdFusion 9 (maybe even 8,) but there are 10 serious changes that ColdFusion NEEDS.

  1. Replace JRun
  2. I'm sorry, but if it's dead bury it. Get the engine to the 21st century. There are several viable options out there including replacing it with GlassFish, Geronimo, or a commercial application server.

  3. Overhaul Reporting
  4. ColdFusion ReportBuilder is a crusty outdated application built for windows only and very few people use it because of that. ColdFusion Builder deserves an Eclipse-based report building tool that understands CFML. Either update Jasper Reports or implement BIRT. If this is done right, Adobe sells more ColdFusion Builder and more ColdFusion... we get better report building tools out of the box.

  5. Overhaul CFDocument
  6. It's common knowledge that the underlying HTML renderer in ColdFusion is ICEBrowser. ICEBrowser did a decent job with earlier versions of the HTML spec, but found it commercially unreasonable to try to keep up with that. Its End-of-Service Life is next year. http://www.icesoft.com/products/icebrowser.html

    It's time to implement WebKit under the covers. WebKit is also the rendering engine used in Adobe AIR, so maybe there could be extra benefits to using this. If WebKit won't do the trick, hopefully Cobra can, or perhaps they go to just supporting XHTML with Flying Saucer. Whatever the answer is, it is probably not to stay on an unsupported OEM.

    A lot of people use this to generate PDF, it needs to be solid and it needs to work with later revs of the HTML and CSS specs.

  7. Fix Server Monitoring
  8. Server Monitoring was a terrific feature in ColdFusion 8 that just didn't make it all the way there. Either spend the time to get it there, or FusionReactor has their act together, partner with them to create an OEM'd version. They get an upsell opportunity for those in need of Enterprise Monitoring and the rest of us get a better Server Monitor.

  9. Re-think Flash Forms
  10. Flash Forms were a great idea when they came out with ColdFusion 7, they are an even better idea today. They probably need to be re-envisioned. But let the server-developers create code within their CFML that creates a rich UI! ColdFusion developers that don't want to go out and learn an entire new development language and paradigm should still be able to leverage the Flash Platform.

  11. Fix Application Deployment
  12. Sourceless deployment is simply not easy enough. CARs are not a bad idea, there just hasn't been enough time spent on making using them easy. Add a deployment wizard to ColdFusion Builder that then brings up my Server Manager so I can point > click > deploy.

  13. Make a Free Edition
  14. Yes, I said it. ColdFusion needs a Free Edition! This was tried once before and failed miserably and so those with corporate memory at Adobe sometimes bring that up (although really the only person left from that time is Ben Forta.) Here's the deal, like everyone else in the world one of these days I will get around to moving my blogs over to some free third party provider (blogger, posterous, tumblr, etc.) Why? Because I'm not going to pay $1299 to run a blog on CFML. All I really want is to stay with my warm and fuzzy CFML while staying with the platform I am familiar with. Give me an edition that just has the nuts and bolts:

    • CFML and CFSCRIPT
    • AJAX and Flash Forms
    • File Handling
    • XML Parsing
    • CFQuery (but I don't need the DataDirect drivers... all the databases provide their own)
    • CFMail
    • CFFTP
    • Deployment
    • BlazeDS (Hey it's free in supports the Flash Platform initiatives, so toss that in too)

    Keep the rest to yourselves. I just want to be able to run a blog and a wiki without paying for a commercial application server for my home computer, and without learning PHP. If you did that, maybe you'd win back some of the PHP market and even create a vendor market around ColdFusion again. Just give me something that has no more features than the free platforms. Worst case scenario, you make a better investment in expanding use of the Flash Platform.

  15. Add real support for Instant Messaging
  16. IM gateways were a cool idea, but supporting XMPP and Sametime is meaningless. Get the other gateways in there. While you're at it, make them part of the default language or easier to administrate. Maybe there is a way to make Gateways more approachable in general.

  17. Update the Web Services Engine
  18. The underlying web services engine is still good old Apache Axis 1. While that is great for backwards compatibility, Apache Axis2 is considerably faster (4-5 times faster) and supports many new features. Axis2 was first introduced in 2004... I would say it's mature at this point. Hot deployment and Asynchronous calls would be hot!

  19. Add a Workflow Engine
  20. Business Process Management is extraordinarily important these days. ColdFusion is often used to build custom business processes. Wouldn't it be awesome to drag-n-drop your way to a new application workflow?

    Take the work that has been put into LiveCycle Workflow or maybe jBPM. The Business Process engine should tail into ColdFusion Components nicely. Implement either LiveCycle Workflow Designer or jBPM Process Designer with some ColdFusion awareness into ColdFusion Builder and you have a winner.

While I appreciate that there are specific needs we all have for our projects, I think the 10 items I have outlined could dramatically change the direction of the product for the better. ColdFusion has recently seen a return to being respected and watched by analysts and media, a resurgence of customers upgrading after several years of waiting to see which way the wind would turn, and an increase in the number of developers using ColdFusion overall. Now is not the time to tweak. It is time to show that not only is ColdFusion surviving, but it is done with just getting back to its former strength on a new platform and instead is now ready to go back and re-invent itself while respecting its original vision, and take on the next set of challenges.

Push for greatness, go ColdFusion.

Jason

Complex Charting in ColdFusion with WebCharts

I did a session a couple of weeks back at RIAUnleashed in Boston and one of the topics I covered was about leveraging more of the WebCharts3D charting capabilities using Java. The point of it was to illustrate how easy it can be to reach down one level into the underlying technologies used in ColdFusion, all you need to know is where they are.

WebCharts3D is the underlying charting engine built into ColdFusion. The GreenPoint site has more information about the technology here.

You may not know this, but ColdFusion comes with a client application for designing WebCharts3d Projects. All you need to do is go to run C:\ColdFusion\charting\webcharts.bat (change as appropriate for your operating system). They have also made a WebCharts Eclipse Plug-in freely available if you are interested in that.

Running these will give you a chart type chooser that will look something like this:

Select your type and you will get a great utility to help you design your chart that will look a bit like this:

Once you have your chart designed, this utility has tabs for getting back the format of the XML needed "style" the chart, the XML needed to populate the chart, and even the java code needed to make it work for a jsp and even how to make it work in an applet, Swing, or SWT app. The jsp code needs a couple tweaks to make it work for CF.

The Style file that was generated for you will look like:

<?xml version="1.0" encoding="UTF-8"?>
<frameChart>
<yAxis scaleMin="0"/>
<legend isVisible="false"/>
<elements>
<series index="1" shape="Area">
<morph morph="Grow"/>
</series>
</elements>
<decoration style="FrameClock" foreColor="#0080FF"/>
<paint isVertical="true"/>
<insets left="5" top="10" right="10" bottom="5"/>
</frameChart>

The data file will look like:

<?xml version="1.0" encoding="UTF-8"?>
<XML type="default">
<COL>2009</COL>
<COL>2010</COL>
<COL>2011</COL>
<COL>2012</COL>
<COL>2013</COL>
<ROW col0="100.0" col1="200.0" col2="100.0" col3="180.0" col4="200.0"/>
<ROW col0="150.0" col1="300.0" col2="250.0" col3="230.0" col4="250.0"/>
</XML>

And then the code to execute this in ColdFusion will look like:

<!--- may need this for lazy initialization of charting engine--->
<cfchart chartwidth="1" chartheight="1"/>

<cfscript>
webCharts3DServer = createObject("java","com.gp.api.jsp.MxServerComponent").getDefaultInstance(GetPageContext().getServletContext());
myChart = webCharts3DServer.newImageSpec();
myChart.width = 320 ;
myChart.height= 300 ;
myChart.type = "PNG" ;
myChart.loadStyles(expandpath('./webchartStyle.xml'));
myChart.model= fileread(expandpath('./webchartModel.xml'));
writeoutput(webCharts3DServer.getImageTag(myChart,"/CFIDE/GraphData.cfm?graphCache=wc50&graphID="));
</cfscript>

Do that and you get a sexy new chart! Stock full of rollover states and all the polish you care to put on it. :)

This probably looks more complicated than it is. From a developer perspective, use a tool to design any chart type you want from the WebCharts charting set (and there are many!), and then figure out how to populate some XML. Add 7 lines of CF code (with only one of them actually creating a java object), and you're done!!!

Now you can create Bubble, Ring, Scatter, Gantt, Gauge, Radar, Polar, Star, Stock, Histogram, Regression, and Doughnut Charts, and you can create Maps and even Heatmaps. The charting world is your oyster!

Easy peasy.

Happy charting!

Jason

RIAUnleashed Slides Posted for CF - Java Relationship

I gave a talk today at RIAUnleashed on how to take advantage of the underlying JEE infrastructure in ColdFusion. The room was very packed, hopefully people found the topic interesting. :)

These slides are hosted on SlideSix.com, a very cool tool for posting presentations online.

I have given a session on this topic a few times now, but I decided to update this session to be a bit more applicable to the issues we run into when developing applications today.

Sorry for text size issues, CFXL, ColdFiSH, and JavaLoader which I refer to in the presentaion are posted on RIAForge.

I hope you find it interesting!

Jason

High Performance String Concatenation in ColdFusion

I was spending a bit of time last night preparing for the CF - Java Session I am giving at Bentley in a couple weeks and I decided to do an actual test on the difference between using a ColdFusion String and using a Java StringBuilder for concatenation. The results were even more striking than I had originally thought, so I decided to pass it on (sorry for the spoiler if you're going to attend my session at Bentley, I will have more than just this to talk about :).) If you want to learn more about leveraging Java with ColdFusion or a number of other topics, check out RIAUnleashed at Bentley College Waltham, MA November 13th.

So, back to my story, I took a string:

appendstring = "There's an old saying in Tennessee -- I know it's in Texas, probably in Tennessee -- that says, fool me once, shame on -- shame on you. Fool me -- you can't get fooled again";
God bless the wisdom of GWB.

And I appended it in a loop using ColdFusion Strings:

for (i=1;i<=iterations;i++) {
    string = string & appendstring;
}
And I also appended it in a loop using a Java StringBuilder:
stringbldr = createObject("java", "java.lang.StringBuilder").init();
for (i=1;i<=iterations;i++) {
    stringbldr.append(appendstring);
}

The results... With Strings I could append this sentence together 20,000 in 90 seconds... not bad right?

As it turns out String concatenation is actually exponential not linear (perhaps its cubic and not exponential... but it deteriorates quickly.) Take a look at the chart below:

Now a closer look at the same data, but extending to a scale meaningful to the StringBuilder:

With a StringBuilder, I could append the same string 1 MILLION times in 5 seconds!!! I actually had the system running out of memory in about 7 seconds (so be aware of that I suppose.) Trying to get to 1 Million iterations with Strings would take roughly "until the end of time"... okay, maybe not that long, but long enough that you would think a process hung on your server last Saturday.

Am I saying ColdFusion sucks at concatenation? No, not at all. The fact is you will have the same results concatenating strings in Java. In fact, a ColdFusion String IS A Java String. The difference is simple, ColdFusion does not have a keyword or object that does high performance string concatenation. There are hacks like appending an array and then using arraytolist(), but how awkward is that?

Next time you need to make a big string, just use a StringBuilder, its really no big deal. :) Remember, ColdFusion just makes your Java development faster, because the app you write using ColdFusion actually executes as Java.

Best of luck on whatever project you are working on today, :)

Jason

Update: 2:04PM October 23, 2009 With some of the interesting comments around other high performance concatenation methods I decided to give a couple a try under my test. The chart below includes String Concatenation, Appending a StringBuilder, Appending an Array and then Flattening it, and using CFSaveContent. Take a look at the chart below:

I think the results were a bit surprising at first, but after some discussion I think I actually get it. First, we know string concatenation is no good, easy. Next, we know StringBuilder's are linear, and they did what we previously expected.

Next up, an Array, you can see from the chart that an array is wicked fast and then the last iteration is costly because it converts to a string there. This made sense to me... the difference here is the array is only consumable as a string after everything is together. I moved the ArrayToList call inside my loop to make that part equivalent and while still on the same order of magnitude as a StringBuilder, it was several times slower. I guess if you have something that you can completely construct as an array and then just convert it when you need to consume it as a String, this is a viable option.

Lastly, CFSaveContent... this one perplexed me so I dropped a line to an old co-worker at Adobe. His insight was interesting, he said that CFSaveContent is essentially grabbing everything you are outputting to the ColdFusion output buffer which is already incredibly efficient and there waiting for strings (html output) to be thrown at it and then grabbing the content and sticking it in a variable. That does make me wonder what would happen if there were contention for the output buffer... but either way, in a single request environment this is incredibly efficient.

Well, very interesting stuff. I guess I would still prefer to use a StringBuilder, it just makes more sense to me to use something designed to manage strings. I can deal with an extra second and a half over 300,000 iterations. It's the hours it would take using a String that I take issue with. :)

That of course is a coding preference, and I encourage you to do whatever is appropriate for your situation.

Cheers again, :) Jason

ColdFusion Non-profit Announced at CFUnited

They just announced a ColdFusion Non-profit that is dedicated to the ColdFusion Community. I think this is awesome!

Ok, I'm cheating a bit as I am one of the co-founders and President of the 4 ColdFusion Foundation. Several of us have been spending our spare time trying to pull a real non-profit corporation together for the benefit of the ColdFusion Community. You should find out more information on the 4 ColdFusion Site at 4CFF.org.

Special thanks from me to the board members that have been working so diligently at this. They are:

  • Sam Farmer
  • John Zhu
  • Doug Morrison
  • Dan Wilson
  • Ray Camden
  • Sean Corfield
  • Jared Rypka-Hauer
  • Liz Frederick
  • Andy Allan
  • and many more
I'm looking forward to having a non-profit for the community and hope you are to. :)

Jason

ColdFish 2.0 Beta on RIAForge

I recently added ActionScript and MXML syntax highlighting support to ColdFish, as well as line number support. ColdFish is on RIAForge here. I have not had a chance to test it out that much as I do not spend a lot of time with AS3 or MXML so I am looking for some people to give me feedback. I did not update the ZIP since that is the stable release.

If you are interested in AS3 and MXML support for ColdFish, please checkout the SVN tree at http://svn.riaforge.org/coldfish/.

Please send me your comments or fill out the issue tracker on RIAForge!

Thanks! Jason

Jason's New Gig!!!

If you are interested in what's been going on my past few months please read on, if not, well, now is your opportunity to stop reading. :)

Since leaving Adobe in December, until this week I had been working full-time as a consultant. I have not had any downtime, even on my vacations I have been working on various projects, client work, my own open source projects (I updated CFXL to use POI, I added MXML and ActionScript support to ColdFiSH... I'll post that another time), and I have also been working with many talented folks on another project that I can't wait to talk about publically (but will wait for the right time :).)

While doing that, I managed to talk to a few companies about full-time work. As of this past Monday, I am now the Director of Technology for FirstComp Insurance. The team here is a phenomenally talented group composed of genuinely friendly people. I don't want to get into too many details about the company, but I can honestly say that I would not have thought insurance could be so interesting. They use a lot of ColdFusion, so if you're a CF or Flex developer that is a guru or want to become one, live in Rhode Island, and are willing to work for a crazy coding fool, feel free to contact me. :)

The past several months have just been so refreshing to me. My hours have dropped from "working whenever awake" to "normalesque" hours. I've been able to spend time with my family and friends, to code out of pure enjoyment for coding, to travel for fun rather than work, and I have been able to fully enjoy the time and discussions I have had with fellow developers (when you represent a large company, you can't always share your true opinion.)

Things have just been spectacular and it just seems to keep getting better. In case you were wondering, I'm alive and well, and am happy to still call myself a CFer!

I wish all of the success in the world to each and every one of you.

Jason

Working with ColdFusion Dates in Javascript

I did not see much information out there on this subject so I thought I would post it. Here is the scenario, you want to return a date from the server and use it in Javascript to dynamically populate something (an input field, some text... you decide.)

When you send a date back from the server using AJAXPROXY, or manually using SerializeJSON(), ColdFusion is extremely helpful and sends the date back in this format.

MonthName, DayNumber Year Hours:Minutes:Seconds

Now... what can you do with that format on the Javascript side? More than you may have realized.

All you need to do is put that date in the constructor of the Javascript Date object. Now you automagically have a Javascript Date object and can use all the methods for that (Check out the documentation on Javascript Date Objects.) Here is some code that you can run to see what I mean.

<cfajaxproxy cfc="myCfc" jsclassname="myCfc" />
<script>
var myCfc = new myCfc();
var myDate = new Date(myCfc.getMyDate());

document.write(myDate.getMonth()+1 + '/' + myDate.getDate() + '/' + myDate.getFullYear());
</script>

The output will look like this.

01/01/2010

I know you're probably asking... why do you have to add 1 to the month. getMonth() returns the number of the month (0-11) starting at 0. Most of the methods start at 0, just add 1 when you need to. The exception to that rule is getDate() which returns the number of the day starting at 1. Also, getDay(), actually returns the day of the week. I find that a bit odd myself, but am sure that there were reasons to do it that way.

Don't forget, you have the time in the object as well. So you can use getHours(), getMinutes(), and getSeconds() to output the time... or you can use myDate.toLocaleTimeString() and javascript will output the time in the appropriate format for the users locale.

Hopefully that will save you a bit of extra time trying to figure out how to return a date from the server and format your date in Javascript.

Cheers! Jason

P.S. This is not an April fools joke. :)

Object Relational Mapping Session at CF.Objective

My favorite conference every year has to be CF.Objective. It's relatively small, but if you ever want to sit down and have a discussion with the thought leaders in the ColdFusion world, it is definitely the place to be.

This year, I will be doing a session on Object Relational Mapping. I know a lot of ColdFusion developers aren't familiar with this development technique and that's largely because the libraries available to developers are still a bit nascent although very powerful.

The point of this session is to talk about what is available today and what will be coming in the future. I truly believe that very soon, ORM will go from being an advanced technique that only a few people use, to a technique that everyone will use because it will be simpler and more powerful than writing direct queries.

Please join me at CF.Objective!

Best Wishes, Jason

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner