OOP out of the gate or Modularize with CFC’s first?

In my post ColdFusion, Procedural to CFCs you will recall that I’m late to the world of OOP and CFCs.  I regret not taking the leap a few years back.  The excuses I’ve made in the past were lame and enabled me to continue forward with my own “modularized” form of coding using cfincludes for queries and templates.  Old school, I know.  Ever since my declaration to change, I’ve been reading a bit to help get my head around OOP basics.

I created my first CFC that calls a database.  I then wrote some code on another page that calls the cfc and then I display it on the page.

I just have a quick question.  Should I concentrate initially building UDFs in CFC’s first or should I be thinking in Objects right out of the gate for the whole application?

CFOOP.org A place to start learning CFC’s and OOP

cfOOP.org is a website dedicated to object oriented programming and ColdFusion

I just came across a nice, neat website cfOOP.org written by Nicholas Tunney. It breaks down OOP into concise, meaningful chunks and relates it all in terms of ColdFusion. I’m about to start the tutorial and I’m looking forward to seeing the results.

One question I’ve always had is how databases and Object Oriented Programming fit in together. At it’s very nature, it seems the two conflict since with databases we break everything down into items that relate to each other. With OOP methodologies, it seems we do the same thing or at least something similar.

It will be interesting to see how this turns out.

Time for my first CFC!

ColdFusion, Procedural to CFC

OK, I’m one of those programmers that started using ColdFusion back before CFC’s. I’m self-taught and was successful early on in life using the “old-school” approach to programming that I never looked back. Then CFC’s came along and I ignored them. I told myself I was fine without them and that the time it takes to teach myself how to adopt them, I could completely build whatever project I was working on at the time
using the old method.

Now, here I am, stuck in a rut and feeling stupid for not seriously considering Object Oriented programming and CFCs. What now? Do I just trudge along the same as usual or do I bite the bullet and try to get my head around a whole new way of programming. I recently integrated a Ray Camden application “Galleon”, open source and available for download here: http://galleon.riaforge.org It’s a nice little forums application that is well thought out and easy to add to any ColdFusion-enabled server. In fact, I bought Ray something off his wish list because I was so impressed. I’ve gone in and modified a few pages here and there and that’s when it really hit me. I don’t know enough about this new methodology to make modifications. Well, I did but not within CFC’s. It’s ugly. I just created a new directory and reference that for all my procedural code. Yuck! I’m embarrassed. I certainly don’t know enough to be able to even contribute to an open source application such as this and I have been writing ColdFusion since 1999! I think it was CF 3.0 for God’s sake! What the heck am I doing?

So, here I am. Feeling sorry for myself and a bit like a 39 year old who is about to watch the young ones pass me by just because I figured you can’t teach an old dog new tricks. Well, I’ve had it. I’m not going to be one of those guys. I’ve got to make some major changes and fast. The question now is where do I go from here?

Here are my goals in no particular order:

Read up on some frameworks and see if it really makes sense to adopt one of these methodologies. I’ve never worked with any framework and I’m worried (probably wrongly) that I’ll run into road blocks based on the limits of the framework.

Actually sit down and read a dust covered book I bought years ago by Hal Helms and Ben Edwards called, Discovering CFCs. I went to a class they offered in Las Vegas called Java for ColdFusion Programmers which was a good course except I never ended up writing a single line of Java Code. I should have taken their CFC course instead. Maybe I should consider doing that now…hmmmm.

Come up with a simple application, which requires completion that I can start from scratch on. It must be something that MUST get done or I will most likely shelve it and never come back to it. NHJobs.com is a good example of why I learned the ColdFusion programming language. In 1998 I had the idea of building a local, New Hampshire-based job board. At the time, I only knew HTML. Once I saw that I could use ColdFusion to send and retrieve data dynamically, I realized the power and usefulness of CF. That’s what I’m hoping for this time around with CFC’s and possibly the use of a framework.

Enough talk, I’ve got to get started. Wish me luck!