Props  |  Art of War  |  Leadership  |  Management  |  Software  |  Security  |  Project Management  |  Music  |  Movies  |  Stuff  |  Info
 
dragonCrew Topics
Truism:
Good, Fast, Cheap. Pick any two - you can't have all three.

Poor management can increase software costs more rapidly than any other factor.

Ben Forta's Blog

 
Prev  Previous |  Next  next  

Cold Fusion


I've been using Cold Fusion since version 4.0 when I was a total newbie to web developement. It was encouraging at the time to see Windows Magazine using Cold Fusion for their site. Why weren't they using ASP? Probably because it along with IIS was buggy, bloated and slow!!!

From my personal experience I'd have to say that the learning curve is pretty easy. There's probably 40 or 50 tags and there's a stable of 10 tags that you'll use on a regular basis. Well most things are easy to learn. The hard part is writing code that is clean and efficient.

What makes Cold Fusion unqiue is it reminds me of Delphi. Allaire (now owned by Macromedia) has put some good thought and innovation behind Cold Fusion's architecture. First they have implemented 2 standard snippets of code that are ALWAYS included with every page that is executed. Application.cfm is always the executed first and OnEndRequest.cfm is executed last. So your code sits in the middle. Well, because the web is a stateless enviroment.

The Good

  • Compiles code into p-code so that it's faster.
  • Built-in application server
  • Built-in logging
  • Built-in database session management
  • Built-in connection pooling
  • Database abstraction allowing you to use basically any database, i.e. Sybase, DB2, Microsoft SQL Server, MySQL and Oracle. You can change DB's without too many coding changes - basically your SQL and this depends on how strict you are not using any proprietary features!!! I only use stored procedures for performance and maintainabiliy reasons but that's another thread.
  • Has built in page and database caching unlike PHP unless you purchase the Zend Optimzer. Well, you can always roll your own!
  • Control the number of threads the Cold Fusion server uses. Remember Windows has a maximum of 1000. Side note, threads are faster than processes. I can't wait to start using Apache 2.
  • Runs on Windows, Solaris, Linux and HP/UX
  • Has Error Handling such as TRY and CATCH unlike PHP 4. Have you ever tried to debug PHP? It bytes! Just biding my time until a production version of PHP 5 comes out.
  • Tags that encapsulate mondane programmer tasks. For example CFQUERY, you don't need to login to the database - it's done via the server administration.
  • Clustering, if you purchase the Enterprise edition. I've never used it though. From a business stand point save your money and buy a load balancing switch, i.e. Nortel's Alteon AceDirector. Here's why, if you have a farm of 4 servers, CF Enterprise which will cost you $20,000. Meanwhile the AceDirectory which has 8 ports is $20,000. The backplane of the AceDirector is 8GB and can handle over 300,000 concurrent sessions. Yeppers 300,000 and I've never seen the CPU's break a sweat.

The Bad

  • Eats memory and doesn't give it back
  • Custom Tags are slower CFSRCIPT.
  • It's a tag based language meaning that it's limted. So obviously there's a lot more functionality with languages such as PHP and even ASP aka VB Script.
  • Can't directly access ODBC error codes. This bytes.
  • Pet Peeve - CF comment block is too similar to HTML. If you miss one hyphen, your code won't execute or display!. But as with any development environment, there's trade offs and this one I can live with - probably because I know about it!!!
  • Oh there's more. When I have time.

There are 4 types of variable types which is pretty unique, Server, Application, Client (stored in database or cookies) and local. Check the manual for their definition and application.

Application Variables

Application vars are variables that are stored in memory. Why query the database everytime you need to populate your drop down list or checkboxes. Just add the code into Application.cfm.

Don't hard code, it's so rook. Say you wanted to change databases. If you had hard coded the datasource you'd have to change every single instance. Now that wouldn't be a good use of time.

Application Var's

Now place the code below into the page where you need to load the countries drop down. By the way CLIENT.Country is stored in the database since I've set storage management via <CFAPPLICATION tag as being a database. Now try doing this in any other language and tell me how much code you would have to write!

TIOBE Programming Community Index for January 2006

Cold Fusion is making a comeback according to TIOBE Top 20. As of January 2006, CF sits in 16th place as apposed it's 25th placing in 2005.
 

CF B-Roll Collapse

Methodology Collapse

Coding Guidelines Collapse

Components Collapse

Security Collapse

Resouces Collapse

Books Collapse

 

 
Top of Page