What does it mean to "Do OO in CF"?

5 views
Skip to first unread message

Matt Williams

unread,
Jul 14, 2009, 11:47:53 AM7/14/09
to Object-Oriented Programming in ColdFusion
I think it would help to have an agreement on what it means to do OO,
particularly in ColdFusion. In the discussion, Ben says he uses CFCs
as singletons to handle things like Security and Emails. In response
to Brian's question, "How much OO do you do?", Ben could respond, "A
small amount." Or he could say, "None at all, but I do use some CFCs
to encapsulate functionality and put them into application scope for
reuse"?

Is an application not considered OO until the entire model is
abstracted, decoupled, encapsulated, and obfuscated? Or could simply
instantiating a user.cfc whenever a user logs in perhaps be considered
the beginnings of OO?

In the case that Ben, with his 5 or 6 CFCs, is doing a small amount of
OO, then I say there is hope for OO in CF and for the masses to learn
this. Encapsulating functionality into a CFC and putting into
application scope seems like a good place to start learning OO. The
next step may be to use a factory to instantiate that user.cfc when a
user logs on.

I guess when Hal says don't do OO in CF, I would ask does that mean
don't use CFCs at all? Is the performance hit so bad that even Ben
should abandon his 5 or 6 CFCs and go back to UDFs?

Brian, Hal, & Ben, thanks for taking the time to put this together. I
think the discussion is quite interesting even though "OO won a long
time ago."

-Matt Williams

Hal

unread,
Jul 14, 2009, 12:38:52 PM7/14/09
to Object-Oriented Programming in ColdFusion
Hi, Matt. No, when I say "Don't do OO in CF", I don't mean not to use
CFCs at all. Rather, don't adopt a full-blown OO paradigm where
everything (or almost everything) is represented as an object. This is
the way OO is done in OO languages -- and I'm a big fan of that style
of development. CF, though, just isn't up to the task.

Jamie Krug

unread,
Jul 23, 2009, 10:24:48 AM7/23/09
to Object-Oriented Programming in ColdFusion
On Jul 14, 12:38 pm, Hal <hal.he...@gmail.com> wrote:
> Hi, Matt. No, when I say "Don't do OO in CF", I don't mean not to use
> CFCs at all. Rather, don't adopt a full-blown OO paradigm where
> everything (or almost everything) is represented as an object. This is

Hmm... Correct me if I'm wrong, Hal, but I recall you objecting to
Brian's mention of doing "some OO" or "how much OO to use," no? This
sounds like you're supporting that case ;-)

And thanks for the thought-provoking discussions, guys!
Reply all
Reply to author
Forward
0 new messages