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?

5 Responses to “OOP out of the gate or Modularize with CFC’s first?”

  1. Raymond Says:

    “udfs in cfcs or straight to oop”?

    haha to anyone but a cf programmer that would sound like you’re talking in tongues.

  2. Justin Says:

    OOP actually requires a boat load of upfront planning. Most of your structure will come from sketches and pen and paper. Try “Head First Object Oriented Analysis and Design”.

    After reading that you’ll be able to move into understand the design patterns a little more.

    You’ll waste a boat load of time if you just start banging away at the keyboard procedural style.

  3. vincentcollins Says:

    No kidding Raymond. Reading it again made me laugh too.

    So what would you say your development approach is? OOP, CFC Modularization, or somewhere in between?

    So far I’m thinking the quickest way for me to get up to speed is to build my next application making Object-like UDFs to encapsulate the business logic. However, I’m having a hard time imagining a fully OOP approach to the display layer. Maybe you or someone else can shed some light on that part for me.

    I hear all the time how there are a lot of “crappy” programs written in OOP languages like Java. The reason they are crappy is that the developer wrote it in a more procedural way with some objects. I’m wondering if I would be heading down this same path.

    I don’t want a developer to open an application I wrote and say “WTF?” :)

  4. vincentcollins Says:

    Thanks Justin,

    Are you talking about this book?

    http://www.headfirstlabs.com/books/hfooad/

  5. Justin Says:

    Yep, that’s the one.

Leave a Reply