OO Principles: Composition

I don't "do OO" development in ColdFusion. I'm starting with that statement not to spark another debate about whether to use OO in ColdFusion, but rather to clarify that while this post is about a principle of object oriented development, you don't need to "Do OO" in order to learn, use, and benefit from composition.

In the last "OO Principles" entry, I talked about encapsulating CFCs. The example that I use was the need to have a datasource in a component. It should be clear from that entry that you could pass in more methods as well.

[More]

OO Principles: Encapsulating CFCs

I don't "do OO" development in ColdFusion. I'm starting with that statement not to spark another debate about whether to use OO in ColdFusion, but rather to clarify that while this post is about a principle of object oriented development, you don't need to "Do OO" in order to learn, use, and benefit from encapsulating CFCs.

When I first started using CFCs, I knew that encapsulation and decoupling were important, but this brought up new challenges. For example, if I had a method that queried a database, how would it know what datasource to use?

[More]

OO? OI? Oy Vay!

Clark Valberg recently convinced Hal Helms, Brian Kotek and Ben Nadel to do a recording together discussing OO programming in ColdFusion.

The discussion reminded me of an NPR debate I listened to several months ago on whether we should bomb Iran to prevent them from acquiring nuclear weapons (unfortunately, I don't remember the specific wording of the question). The debate had three experts on either side of the question. All six seemed to agree that we would almost certainly never need to bomb Iran because so many better options exist but that we should remove the option from the table (just in case). From there it quickly moved to a semantics debate about the wording of the question on the table.

[More]

OO Principles: Separation of Concerns

I don't "do OO" development in ColdFusion. I'm starting with that statement not to spark another debate about whether to use OO in ColdFusion, but rather to clarify that while this post is about a principle of object oriented development, you don't need to "Do OO" in order to learn, use, and benefit from separation of concerns.

In order for separation of concerns to work, your code really needs to be well encapsulated first.

What

Separation of concerns dictates that different modules of code overlap in functionality as little as possible. For me, this means that I have .cfm templates for output and .cfc components for logic and data retrieval.

[More]

OO Principles: Encapsulation and Decoupling

I don't "do OO" development in ColdFusion. I'm starting with that statement not to spark another debate about whether to use OO in ColdFusion, but rather to clarify that while this post is about a principle of object oriented development, you don't need to "Do OO" in order to learn, use, and benefit from encapsulation and decoupling.

This will be the first in a few entries about how to take advantage of OO principles even if you aren't using OO.

[More]

What is this OO?

The recent discussion on OO programming has created quite a bit of discussion, some with more heat than light, but other thoughts that have been illuminating. Some discussions covered whether or not OO has "won" over procedural programming. Some have suggested that those avoiding OO do so because they are unable or unwilling to learn new things.

My favorite thing, however, was "sipping the [OO] kool-aid" by Matt Williams (I owe you a beer, Matt!).

[More]

The Trouble with OO?

Marc Funaro recently posted a blog entry called "How OO Almost Destroyed My Business". It is a good entry, inasmuch as it is thought provoking.

It is a bit long, however, so hopefully he will post a shorter, more organized entry to the same effect later. Even at its long length it is a worthwhile read. The stream of consciousness style does help demonstrate his experience and feelings.

I started to post a comments, but my thoughts ended up running a bit long.

[More]

I Never Break Encapsulation (almost)

One of the larger systems that on which I work runs multiple sites from one code base. Each site needs to have some data that is specific to that site. For example, each site should use a different from email address and mail server when sending email.

During the initial development of the system, I decided to give each site its own application scope. After that, I don't have to worry about which data is site-specific and which isn't. Despite a continually growing number of sites, this has worked pretty well for more than five years.

Then the use of one of my own open source projects revealed a problem with this approach.

[More]

Why I Don't Do OO

This is an entry that I have been intending to write for some time. I keep putting it off. Perhaps because I don't think I will explain myself well, perhaps because I don't want to be flame-bait.

T.J. Downes recent entry "Why Aren't More CF Developers Using OO Methodologies and Frameworks?" made me decide that now is the time.

He asked those of don't use OO to explain why, so I will do my best to explain why I don't.

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.