Mastering The ColdFusion Application Framework

Posted June 1, 2010 at 8:38 AM by Ben Nadel

Tags: ColdFusion

When most people hear the term, "Framework," they think about products like ColdBox, Model-Glue, Mach-ii, and FW/1. What most people generally don't think about is the robust and powerful framework that comes already packaged with ColdFusion. The Application.cfc component is an event-driven front-controller that affords the programmer extremely granular control over all aspects of the application lifecycle, from the macro events down to per-user-request application and session overrides. Come to this presentation to learn about what a ColdFusion application really is and how you can leverage the ColdFusion application framework to build more elegant software right out of the box.

 
 
 
 
 
 
Mastering The ColdFusion Application Framework Presentation Slides. 
 
 
 

Watch the video presentation, feel free to check out the slides or download the code samples. You should be able to just drop the code samples in and run them, no configuration necessary.

NOTE: If you get odd behavior, you might have to delete your domain cookies between some of the code samples - they tend to use the same cookie names.




Reader Comments

Jun 1, 2010 at 9:00 AM // reply »
3 Comments

Really nice. Thanks Ben.
Just a quick note, you have a typo on pages 7,8 and 11 with your pink 'Reqeusts'


Jun 1, 2010 at 9:05 AM // reply »
11,243 Comments

@Alain,

Ah yeah, the magic of copy-paste :) Since they are in graphics, I may or may not get to changing them. I'll see what the week looks like. Thanks for bringing them to my attention though.


Jun 1, 2010 at 9:26 AM // reply »
44 Comments

Great topic. I just find it a bit strange that the "framework" aspect of ColdFusion is the reason why it's not included on the TIOBE index.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

They consider it more of a framework than a language.


Jun 1, 2010 at 9:29 AM // reply »
11,243 Comments

@Jose,

What??? That's ridiculous! The ColdFusion framework is very much in the same vein as C# Global.asax and what not and they are on the list!


Jun 1, 2010 at 9:52 AM // reply »
14 Comments

Very nice slides Ben. tbh, I find looking at the presentation slides without any voice over it is a little...weird :-P Looking forwards to your video!

You made a good point that many people don't realize CF is already a framework by itself. But there seems to have no clear tutorials of how to set up an application and this leads to various coding styles. Good and Bad. So framework came in to help people follow a particular standard that helps sharing codes between teams/teammates easier.


Jun 1, 2010 at 9:58 AM // reply »
11,243 Comments

@Vinh,

Yeah, there's nothing in the ColdFusion framework that forces you to do anything in a particular way - it's not *that* kind of framework. It has more to do with the page request mechanics and association life-cycle and application events than with any kind of "standard".

I'll hopefully get the video done in the next few days.


Jun 1, 2010 at 10:09 AM // reply »
14 Comments

I find "framework" kind of a buzz word where people tend to use it quite loosely. Some guys who have been coding with CF for 10 years without using any "frameworks" like Coldspring, Fusebox, (or cfTrigger :-P) etc. and slowly develop his own coding styles, then he calls it his framework :-)

If you are working on your own project, I dont think it matters what you use, maybe just the CF out-of-the-box framework, as long as it helps you finish the job. But the use of framework is more important when more people need to work together either now or in the future.

I actually got some "hard" time convincing my work mates using cfTrigger as they claim they have their own "frameworks"! :-(


Jun 1, 2010 at 10:17 AM // reply »
44 Comments

@Ben

I think a good compromise for TIOBE would be to bundle all the CFML engines (ColdFusion, Railo, OpenBD) into one "CFML" label, but I highly doubt that's ever going to happen. I think the only group with the official size of the CF developer community is Adobe. The way I see it, as long as you have work and jobs are out there, who cares what everyone else says? Haters gonna hate!


Jun 1, 2010 at 11:48 AM // reply »
13 Comments

Excellent write up. I've been doing a lot of work with writing API's recently. Both RESTful and SOAP. We should chat sometime about an API framework / best practices for ColdFusion developers.


Jun 2, 2010 at 3:19 PM // reply »
6 Comments

Ben, I really digged your presentation in Amsterdam and it was cool meeting you!

I am applying the session technique in a CFBuilder extension now :) Will get back at you soon.

Cheers,
Deepak


Jun 2, 2010 at 4:57 PM // reply »
270 Comments

@Jose, @Ben: http://apple.slashdot.org/story/10/06/02/1930209/Objective-C-Enters-Top-Ten-In-Language-Popularity (Slashdot article) says that tiobe bases its rankings on search engine results. But I got a 404 Not Found when I tried to go to the URL of the tiobe page that supposedly explained that, so who knows if it's true.


Jun 3, 2010 at 10:24 AM // reply »
44 Comments

"When most people hear the term, "Framework," they think about products like ColdBox, Model-Glue, Mach-ii, and FW/1."

CFWheels gets no love once again :(


Jun 3, 2010 at 10:32 AM // reply »
44 Comments

@Tony

That's too bad considering CFWheels has the best video tutorials I've seen to date.


Jun 3, 2010 at 10:34 AM // reply »
11,243 Comments

@Tony, @Jose,

Awww, nothing meant by it. I know the CFWheels people - great guys.


Jun 3, 2010 at 1:18 PM // reply »
34 Comments

Tiobe I think has it wrong, but java is on the list so not all is lost. Just not sure where Coldfusion in of itself is a really a framework ( I like classic definitions of words and ideas, I'm talking explicit frameworks - get your mind out of the gutter Ben ). Coldfusion is akin to Dbase III (oh that was fun to code in) and lots of 3&4GL languages from the '80 and '90s.

Ok I like the Presentation and surprisingly even without audio very approachable. Nice work.

Did I ramble? Do I care? its my day to be Snarky! :D


Jun 7, 2010 at 10:13 PM // reply »
11,243 Comments

@Kevin,

Thanks my man. I still mean to make a recording of this. I actually have one already, but I don't care for it. After giving the presentation 4 times, I think the next version will be much better. Hopefully by the end of the week.


Oct 9, 2010 at 6:59 PM // reply »
11,243 Comments

@All,

Hey guys - I finally recorded a video of this presentation and posted a video to it - there should be a link in the blog post itself.

Nothing like a "few" months to get it done :)


Oct 10, 2010 at 8:16 PM // reply »
1 Comments

Great presentation, Ben! I love it! Great timing, too. My company is about to start standardizing our codebase with a framework and this helped out greatly!

Thanks!


Oct 10, 2010 at 9:34 PM // reply »
11,243 Comments

@Ryan,

Very cool! Glad I could get this in here finally!


Nov 2, 2010 at 10:37 AM // reply »
3 Comments

I have a serious problem with one of your tips, Ben. I have built quite a big project in several months on my development pc. I used the tip in demo 11 where you encrypt the url parameters. It works fine on my development pc, which is running Apache. But the production server runs IIS and it seems that IIS can't handle long unfriendly urls. If about more than 2 urls parameters are encrypted the string gets too long and IIS generates a HTTP 400 Bad Request error. Do you have any tips for me to solve this issue (replacing IIS by Apache is not an issue).

Thanks in advance.

Frank


Nov 2, 2010 at 10:42 AM // reply »
11,243 Comments

@Frank,

Hmm, that's a tough problem. I do know that some servers have problems with the amount of data that gets passed in the URL; I have never personally run into this problem myself, however. I'm afraid I don't have any good advice for you this matter :( Perhaps try the StackOverflow site?


Nov 2, 2010 at 10:47 AM // reply »
3 Comments

Hi Ben,

Thanks for the quick respons. What drives me to nerves is that actually the urls aren't that long (less than 300 chars). The edge is at about 280 chars or so. If you don't know a good solution than I have to find another way to solve this.

Thanks again.

Frank


Nov 2, 2010 at 10:53 AM // reply »
11,243 Comments

@Frank,

Yeah, that doesn't seem all that long. Perhaps they will remove this constraint one day. Sorry I couldn't be more help.


Nic
Nov 2, 2010 at 2:25 PM // reply »
1 Comments

IIRC IE truncates at less than 300 chars (might be 255). Some things to look at:

1. Can you obfuscate in a different way that results in shorter URLs?
2. Should the data be posted?
3. What can you store in session variables to be passed to the next page instead of passing on the URL?
4. Does the data really need obfuscated?


Nov 3, 2010 at 6:40 AM // reply »
3 Comments

I have done a better look into my code and I noticed that the maximum number of url parameters to encrypt was 3 sometimes 2. I have done several improvements to reduce the number of parameters and it works now. The downside is a few more query calls in the controller to obtain the other needed parameters.

But it works now and that's most important.


Nov 3, 2010 at 10:13 AM // reply »
11,243 Comments

@Frank,

Cool - glad you got it working.



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 23, 2013 at 4:26 PM
ColdFusion QueryAppend( qOne, qTwo )
@Heather, Glad people are still getting value out of this! ... read »
May 23, 2013 at 3:49 PM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@WebManWalking, I meant the code at the bottom (not the video). I did try to experiment with an intermediary variable, like: value = users.id[ i ]; arrayContains( userIDs, value ); ... but t ... read »
May 23, 2013 at 11:06 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, Are you talking about As Number: YES As String: YES As Java: YES? If so, that's with 3 different ways of referencing the constant 1, not users.id[1]. Query object references(*) are what seem ... read »
May 23, 2013 at 9:55 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Dan, According to the CF Admin, I'm running Java "1.6.0_45". As far as the DB column, in the database it's an INT. I'll see if I can dig into what CF sees it as. @WebManWalking, But h ... read »
May 23, 2013 at 9:49 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, I think the problem is that we're used to loose typing in ColdFusion, like JavaScript. If a value is a number but it's needed in an expression to be a string, noooo problem. I've encountered ... read »
May 23, 2013 at 9:47 AM
ColdFusion QueryAppend( qOne, qTwo )
You rock! Thank you, thank you, thank you!!! ... read »
May 23, 2013 at 5:19 AM
Ask Ben: Print Part Of A Web Page With jQuery
How to print also the background color of table cells and table lines ... read »
May 23, 2013 at 3:55 AM
Javascript Array Methods: Unshift(), Shift(), Push(), And Pop()
very interesting and helpful too. ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools