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?
Vince Collins
September 15, 2007 at 4:12 pm
“udfs in cfcs or straight to oop”?
haha to anyone but a cf programmer that would sound like you’re talking in tongues.
September 16, 2007 at 10:05 am
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.
September 16, 2007 at 10:11 am
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?”
September 16, 2007 at 10:19 am
Thanks Justin,
Are you talking about this book?
http://www.headfirstlabs.com/books/hfooad/
September 17, 2007 at 8:23 am
Yep, that’s the one.