Return a list of related records in SQL Server

I absolutely love SQL (especially SQL Server) and I love how I continually find new ways to solve problems with it. I wish I could remember where I first found this tip to give proper credit, but I really love it.

Have you ever wanted to return a comma-delimited list of records in SQL Server? It turns out, that it is actually pretty easy to do.

For example, if you have users that can work in multiple regions and you need a list of which regions they work in.

[More]

Safer and More Dynamic ColdFusion Page Caching with cf_MrECache

I looked at quite a while back and I liked the idea, but it lacked a little bit of flexibility that I wanted in pursuit of my caching strategy.

I recently covered MRECache and now I'd like to briefly cover a custom tag that is built around it.

At its heart, cf_MrECache just wraps up a block of text (HTML or whatever) that you want to cache and caches it just like cfcache, except that is uses MRECache under the hood. Of course, if that were all that it did then it would hardly be worth making in the first place.

[More]

Thoughts on Caching Strategies

I've been thinking about caching strategies for different scenarios lately. I wanted to write down a some thoughts on what seem to have been working for me. Hopefully this will help me organize my thoughts and maybe others can help tell me if my thinking makes sense or if I am missing something.

[More]

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]

Beany.cfc: Part 2

I wrote earlier about my Beany component for handling Beans (especially immutable ones) easily. I thought this time I'd just cover a few extra little features that I've added to it to make it a bit easier to use.

[More]

Beany.cfc

Despite not being a big fan of Beans generally, I do find that there are situations in which they are useful. One of those is as configuration objects to pass in to a component. I can add the data in one packaged set.

In reading about Clojure recently, one of the big advantages of Clojure is immutable variables. I wouldn't want immutable variables in ColdFusion all of the time, but it would be really nice sometimes.

[More]

Git Branching Strategy for Web Development

There is no doubt at this point that Git is a successful version control system. GitHub is, so far as I can tell, the most popular place to host open source code. There are several popular software programs for managing Git and two very popular Git branching strategies.

Each of the two most popular branching strategies that have I seen does a great job of solving the problem for which it was created. GitHub Flow is great for open source projects. The basic idea is that work is done via cloning and merge requests.

[More]

Better Exception Handling in ColdFusion

We have been using basically the same exception handling strategy for several years. It has worked pretty well in all of that time, but we recently decided to switch it up. Our previous exception handling system (the one that we have been using for years) made sure not to display valuable information to users, but did send us an email with the pertinent information.

This made for a system that was reasonably secure (in that it didn't share any sensitive data on screen), but still allowed for us to quickly find out about any problems so that we could take care of them.

[More]

More Entries

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