I want to welcome new readers from MXNA and Fullasagoog. I hope that there is a little something here for everyone. You can read my Welcome post for a little more about what you might find here at Cutter's Crossing, and you can check out Who I Am for a little more information about me and what I might bring to the blogosphere. Again, welcome one and all, happy reading, and let me know what you think.
So, now anyone following along has had plenty of time to come up with a few items they might include in a page template, variables that might change but layout consistent. Let's take a look at how we might apply the same layout from several different programming perspectives.
First I think we'll start off with basic includes. This is a technique used over and over again, and something that might apply in many different web development languages, but we'll just use trusty old ColdFusion. Let me point out something you don't want to do. Do not place your header and footer includes inside your Application.cfm (or cfc) or OnRequestEnd.cfm. Doing so would strip you of higher levels of control of your output and leave you in the wind if you require alternate displays on different pages, plus could cause you issues should you begin to use AJAX in your applications.
So tonight I did a presentation for the Nashville ColdFusion User Group on Object Oriented Development with Model Glue:Unity. This was a preso I was supposed to do last month, but some minor confusion with a new location (and the happy birth of a child a few days prior) had me standing in front of an audience of one. This actually worked out great, because it gave me an extra month to prepare, and allowed Aaron time to figure out the best way to record the presentation via Breeze (or 'Adobe Acrobat Connect Professional', as it is now called.)
This preso covered some "Why should I?" type questions, basic setup of the Unity frameworks and sample application template, as well as a hands on demo of using Reactor to do the grunt work. I need to give a big shout out to Aaron for picking up a really nice Logitech USB Headset w/ Mic the day before, as well as a thanks to all of those who attended either live or via the breeze session.
Once again, you can view the recording that Aaron put together during the presentation, or just go to the Nashville ColdFusion User Group's website. I'm including a FlashPaper copy of the slides with this post (the Download link below), but the hands on demo is in the presentation.
OK, well I've made the jump to BlogCFC 5.5.002. Can I tell you that it is almost impossible to keep up with Ray Camden. The man is a fiend. I have no idea how he finds the time to manage his job, family, side work, and tons of open source projects. The guy is truly amazing. Thanks again, Ray, for everything you do for the CF Community.
As some of you can tell, I will have to look into a few changes now. I'm using the 'liquid' layout here, so some adjustments will be needed to handle the graphic at the top of the page. But that, my friend, is for another time.
I'm also going to incorporate a new 'about' pod that Charlie Arehart has sent to me. We've been going back and forth in email on some common interest stuff, and he pointed out to me that I don't have any sort of 'identifier' on my blog. This new pod will be great. Thanks a lot Charlie!
In every project there are gotchas, little unforseen issues that must be worked through as you migrate from development to production. In a previous post I brought up transitioning a Model-Glue: Unity application from a Windows development platform to a Linux platform while using two slightly different versions of MySQL. That would be one example.
Another recent project serves as a case in point as well, creating compliant header/nav/footer includes to be used site wide for a small site. Easy work, three or four files, including the stylesheets, with some example usage templates thrown in and a lot of comments for the developers who would use it. Oh yeah, did I mention it had to work on ColdFusion 5?
A vibrant discussion is in the ongoing comments to Ray Camden's recent entry on remembering 9/11. Ray makes a great parallel as to how 9/11 is, to our generation, what the Kennedy Assassination was to our parents. He also tells an interesting, and troubling, story of personally experienced (by his wife and son) xenophobic backlash in it's aftermath. 9/11 will be a day remembered for many generations to come, in many different ways by everyone.
Ray and I often share opposing political views, which is one of the fantastic things about living in our great nation - the fact that we have the right to actually have opposing views, much less express them openly (that's one point I think Ray and I can agree on). I want to preface this by saying that I am not posting this in total disagreement with his post, but rather in counterpoint to some of the comments generated from his post (and some content, but hey, we can do that). If you are easily offended then stop reading now, as I have stated before that I am not, nor will I ever be, Politically Correct.
Wow, the things you forget over time. You start to work in a certain environment for so long that you take on bad habits by example of the work you are associated with. Trouble, with a capital 'T'.
Case in point. I was contracted out for a very small job, a friend of my company's Technology Director wanted to put a football pool on his website. Very straight forward, even for a guy like me who has little to no interest in sports. He sent in a hand drawn diagram of what he wanted each screen to look like, and exact instructions on the function of each page.
Easy. Simple. No brainer. So, I quoted him 4 hours of work. I wrote it in Model-Glue: Unity to play and learn, knocked it out over 2 days in about 8 hours (giving for learning curve), and had it fully functional on my server for testing. It worked great, and the client was getting a little more than he asked for in the process.
But then you have to deploy to production. Client's server environment. And this client was with a shared hosting facility. After three hours, and countless phone calls, they finally had all of the cf mappings set up correctly. This was necessary, since their site was not the webroot. I hit the page, and BAM!, error. My flawless little app was not functioning as intended, at all.
At first I thought it might have something to do with folder and file permissions. No dice. I was seeking advice left and right. Finally I asked Ray Camden for his thoughts, and he says "Look at case sensitivity."
Well, it was a Linux server. But, the majority of the pathing code was written by Model-Glue, so I was a little stumped.
With my version of MySQL, all table names are lower case, but queries can reference them without case sensitivity. In their version of MySQL, case sensitivity is queen (and a bitch at that), and can cause you great heartache.
You see, Model-Glue and Reactor autogenerate many files from your scaffolds and the Reactor.xml file, and use the same case sensitivity as that of your scaffolds and object setups. I had to recompile the site, page by page, with an adjusted config files, and then re-customize my display templates, plus rename a few thing within my Controller.cfc file.
So, in hind sight, I probably could have just changed the table names to the same case sensitivity as I had used in my files, but I just adjusted all of the files anyway. My overall point is this, always watch your case sensitivity. You may know, from the beginning, where and on what your application will be deployed, but what happens if your client decides to switch hosts the following year? Nightmare, with only yourself to blame. Be case sensitive to everything: paths, db tables and column names, CFC methods and arguments. Everything. You will save yourself a lot of trouble in the long run.
OK, back to it. It's been a little while, so you may want to go back and review parts 1, 2 and 3 before continuing. At this point we've created a very basic structure, giving you a basic, standards compliant document and stylesheet. But, you still don't really have any content, just a header with a bogus title, a spot for a menu, and a container for content and a sidebar. Where to next?
OK, it's been a little busy. BlogCFC has had a few updates (which still need to be applied here). One of the nicest updates I've seen is the liquid layouts. I replaced the Alagad image component with Efflare's imagecr3 tag. After extensive testing, I (and my colleagues) have found that the java imageio based tags were just not stable enough, nor was the conversion quality up to par. After looking through our (3,000+ templates) codebase, I wrote a new image.cfc wrapper for the imagecr3 tag, writing functions with names that matched those we were using within the Alagad component. Although the update to our three production servers definitely outlined our need for version control, overall the replacement of the image.cfc worked like a charm.
Stay tuned. I'm hoping, this week, to post another installment to my tutorial on "the View", where I'll begin to get in to making the templates dynamic. We might also talk about the use of <cfinclude> inside of CFCs and UDFs (some things to be aware of).
OK, what are Damon Cooper and the Adobe crew up to? There a post on Damon's Blog on What's Your Ultimate ColdFusion IDE? This has gotten some very interesting responses. Overwhelming support for CFEclipse, with suggestions on what to extend in it's feature set (everyone says 'Debugging').
And then Damon makes this cryptic remark:
Guys, thanks for the feedback this far. Much appreciated. We've heard you all loud and clear, and I, at least, realize now more than ever from this small sampling of feedback that our suspicions were correct.
I sincerely hope we can both pleasantly shock and awe you with what we have on store.
I will say this: the solution we come up with may not be what you're expecting, but it may be what just what you've wished for :)
Wow, do these people know how to tease us or what? I know that I saw at least two comments telling them to hire Mark Drew (and mine was one of 'em). I also saw quite a few things mentioned that I believe the CFEclipse crew is already working on (at least in R & D). Tell me, what do you think?