Pluralizing in ColdFusion

A few (ok, ten) years ago, I needed to generically pluralize English words in ColdFusion. Also, I wanted to be able to reverse that out ("singularize" as it were). This should be a really easy problem: If it ends with an "s" then add "es"; If it ends with a "y" then ditch the "y"; Otherwise just add "s". It turns out, though, that English is delightfully complicated.

So, Pluralizer.

I created it ten years ago, and I've used a fair number of times since. It isn't complicated enough that I've needed to update it much in that time.

[More]

Easy Caching in ColdFusion with MRECache

I avoided dealing seriously with caching for more of my programming career than I like to admit. Perhaps the old saw that "There are only two hard things in Computer Science: cache invalidation and naming things." (Phil Karlton) held me back.

Beyond that, though, I think I always had a sense that I didn't like the approaches that I found.

A few years ago, however, one of my clients started looking ahead to a major increase in traffic along with an increase in complexity. So, I needed to look into caching.

[More]

Implementing the Observer pattern in ColdFusion with Observer.cfc

Often I want to respond to events in a component, but I don't want it to need to know anything about the component that is taking action on it. This is often when I am using a generic component on my site.

The Observer pattern is perfect for this.

I didn't find an existing Observer implementation in ColdFusion that I loved and I wanted to try my hand at it, so I created Observer.cfc.

[More]

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