Wednesday, July 23, 2008

ColdFusion 9: Server.cfc

I have been pretty quiet about ColdFusion 9, aside from a few comments here and there. I wanted to take a moment to comment on Server.cfc. I'll be blunt and say that in it's current described form I think it will be useless. First let me describe Server.cfc. Server.cfc will provide users the ability to hook into the server start up and shut down events. This will be done by creating a Server.cfc. With this you can now react to onServerStart and onServerEnd.

Sounds promising right? Here's the problem, you can have 1, yes 1, Server.cfc per ColdFusion instance. How many of us deploy 1 application per ColdFusion instance? I know we certainly do not do this, heck we generally deploy 30+ apps to one CF instance. So now if I want each application to be able to do something at start up I have to constantly add functionality to Server.cfc for each application. This seems like a monumental mistake. I'd rather see the server hooks added to Application.cfc and the server scan for Application.cfc files on start up. ColdFusion has come so far to make application self sufficient (mappings, session control, settings override) making one Server.cfc would be a huge step backwards if you ask me.

Tuesday, July 15, 2008

Improve Code Quality: Peer Design

As I work on my presentations I enjoy sharing some of my thoughts along the way. This will be the first of a series of entries that talk about concepts I plan to cover in my presentations. This is mostly a practice of thinking out loud but I think, or maybe hope, they will make a good series of blog entries. Of course, my opinions might change as I collect more and more empirical data, I'm very pragmatic, but I just have to share this knowledge pent up in my head!

What I am about to say may well change the way you think. You might think I am am a blooming idiot for saying it but I hope it helps folks improve their code's quality. Unit test do not improve your code's quality. Pause for a second and let that sink in, unit tests do not improve your code quality. They measure and verify code quality but they themselves do not improve the quality of your code. Think about it, running unit tests over and over again will not improve code's quality. I'm not intending to undervalue unit tests but it is important to realize unit tests improve the application's observed quality by ensuring properly functioning code. Unit tests do not improve your code's quality and more importantly maintainability.

Once you come to accept this fact the question you may be asking yourself is how does one improve the code's quality? Coding standards provide a good quality baseline and may serve to enforce some code quality, TDD can help improve the code quality (a node to unit tests), code reviews could certainly help improve quality, and design up front might help code quality as well. The truth is we all have different techniques to improve the quality of our code and I will discuss each one of the aforementioned topics in the future, and in my presentation.

Today I wanted to spend some time discussing peer application design. XP advocates may be keen to note I left off peer, or pair, programming from the list techniques to improve code quality. I did this with good reason, I do not like it. In my experience it is a waste of a developer, I'm not saying it is a bad technique for everyone but I am not an advocate. The reason for my lack of enthusiasm towards peer programming is I favor peer design. In my experience peer programming really turns into peer design only with lots of code being written and rewritten. Peer application design is when a group of developers/architects, not necessarily limited to only the developers of the system, have a design burn down of how the domain(s) should be modeled. It certainly does not need to be limited to the domain(s) but since at Kroger we have a fairly standard framework stack most of the design discusses focus in the domain modeling and not other aspects of an application. Peer design forces us to use our whole brain as we must first internalize our rationals then verbalize, and often times defend, our rationale with others. At the same time, or near same time, we are internalizing others' concepts and mapping them to our own. Peer design has the added benefit of cross training, since we are including peers that are not planned developers on the system in design. Peer designs, just like their big brother JADs, do not generally just happen; they need coordinated and a strong facilitator ensuring the flow and guiding decisions in the correct direction. This is not to say you can not do a quick peer design with one other person at the bar on a Friday night but generally they are slightly more organized than that! Generally the output of a peer design session(s) is some sort of map for development. The map could be as simple as a cave drawing on a bar napkin or as sophisticated as a set UML diagrams. The diagrams, whatever form they come in, are much easier to change and morph than large chunks of code that you will get with peer programming. In a future entry I will talk about code reviews these diagrams can be very important in code reviews.

Friday, July 11, 2008

Hello Adobe Feeds!

I'm glad to get aggregated by MXNA err no Adobe feeds. Hopefully it will expose the blog to some new readership! Being on the Steering Commitee for Open BlueDargon I was thankful to see Adobe still pick me up. I love ColdFusion and I love CFML even more, I think there is room for both open source and commercial, though I wish Adobe would open source ColdFusion I suppose we can't have everything. Right before Adobe Feeds started to aggregate my blog I had an excellent post about the cost of ColdFusion and justifications for that cost. Some have complained about my misleading title but it really is all about how ColdFusion's platform IS worth the price, for some people.

Wednesday, July 09, 2008

ColdFusion Costs too Much

That's a pretty common phrase I hear from folks looking at ColdFusion for the first time. Even scarier I hear it from folks inside the community! Don't get me wrong I love open source and I think there is plenty of room for open source CFML engines/platforms but when it comes down to it ColdFusion's platform for what it offers is a great deal. I get tired of hearing CFML developers tout the RAD of ColdFusion this used to be an okay mostly valid sell but the market has changed yet CFML developers montra hasn't. With a good framework and IDE Java can be pretty RAD these days, besides no one has ever quantfiably proved how much faster ColdFusion, or CFML, really is for development. What follows is an exceprt of a response I sent to a certain "journalist" when confronted about Open Bluedragon, he opened stating ColdFusion's (Standard) price at a mere 1300 was "unbeleivable":
... I'll be the first one to pimp the open source offerings but I also think there are some misconceptions of costs for ColdFusion. If you consider what the Adobe ColdFusion platform offers this [$1300 price tag] is pretty reasonable. What you or anyone needs to ask themselves, especially now with other CFML engines is, "Does the ColdFusion Platform offer me the features I need for the cost?" It seems more and more folks answer no to this but let's think about this for a second. Can Java produce a PDF? Certainly. You can use Java libraries and generate a PDF just fine. Without a bit of work though and a couple layers of abstraction generating an HTML equivelent and a PDF is tedious and can be costly when supporting an app long term. ColdFusion offers you a very simple and elegant way of generating a PDF based off purely the HTML you are already generating. Any pure Java shop can do this too but they need to either modify some open source HTML parses, write thier own, or purchase icesoft's parser (cost: nearly on par w/Adobe's ColdFusion). So with this feature alone all costs, never mind productivity gains of CFML, are nearly negated. Also consider JMS integration. Once again I could develop a nice abstraction layer in Java no problem but then my team is responsible for integration testing, regression testing, and support for this abstraction layer. Not nearly the same if I just use ColdFusion and it's JMS & ActiveMQ integration points. Testing is a real cost and relying on a commercial product is a huge cost saver. A final example to consider is ajax. Have you ever looked at how much a pain it is to refactor from ExtJS 1.0 -> X.X, or jQuery with the UI widgets? The api for ExtJs (and other js libraries) constantly changes and backwards compatibility is becoming a cost barrier to upgrading on large applications. By using ColdFusion's ajax tags you never have to pay a developer to upgrade your codebase to work with the latest version of ExtJS. Adobe is taking care of that for you behind the scenes. Now lets bring this full circle, these are only 3 examples I thought of off the top of my head, there are numerous other cost saving and value adds in the ColdFusion platform so the question really is are these worth it to you? Maybe they are (we certainly take advantage of some of these at my company) maybe they are not. If all you are generally interested in CFML and not the ColdFusion platform, great there are some awesome alternatives now through some open source offerings like OpenBD, Railo and, to a lesser extent, Smith Project. Each OS offering offers their own platform stuff, Open BD for example has a plugin for JMS. Railo, for example, has some very cool integration with Amazon's S3. ... ColdFusion's price point is very valid in many instances for many folks. I am an advocate for open source CFML, no doubt, but I am also an advocate for ColdFusion as it has solved many problems for the company I work for and done it at a huge cost savings.
Hopefully this spurs some good discussion and ideas on how ColdFusion is a money saver and not just from a RAD standpoint.

Saturday, July 05, 2008

Pulse2 now with mxUnit

In the past I've blogged about Pulse2 and I have to say it really has grown on me over the previous month or so that I have been using it. I've decided the $6/month is worth the investment as it does save me time and hassle as well as preconfiguring some of the "extra" plug-ins. On the free side though Pulse2's catalog has grown and that includes listening to my previous post and adding mxUnit for all the CFML developers out there! Finally, with this plug-in added I have posted a public profile for anyone that wants to give eclipse a try but have been intimidated by eclipse setup. Check out Pulse2 and use my public profile. Everything you'll want is packaged in there (add Aptana with a freelance account for an ever better development experience). Pulse2 is an awesome tool and something I definitely plan to demo very briefly in my Be Lazy, Use Ant session at cfdevcon. Don't wait for me to demo it though it is dog simple check it out today:
Check out Pulse