by Leon Rosenshein

Real World Patterns

You've probably heard of the Gang Of Four's Design Patterns, and I've talked about some of them already. There's some really good ideas in that book, and like all things architectural, using the right pattern at the right time makes things easier in the future. Get it wrong and not so much.

Probably the most common mistake I've seen with those patterns is overapplication. People learn a pattern and then apply it everywhere. I've done it. For me the singleton was the worst. When I first saw that I *knew* that it was what I had been looking for. Singletons started popping up in my code everywhere. Inside classes. Across classes. It wasn't until I ran into the Special Order pattern of singleton creation that I realized I had gone too far.

There are plenty of other lists of patterns out there. Below is a list that I think has a lot of connection to code as seen in the wild. I have to admit that I've been known to use the Clone pattern a few times, and Retroactive Formalization is definitely the best way to make sure you meet the design requirements AND have the docs match the code, at least for a while. What other real-world patterns have you seen?