some thoughts on the “Design Pattern” pattern
I’ve trying to document some solutions that I have come up with, and I am having a really hard time. I’ve been trying to follow the classic design pattern format: context-problem-solution. The problem is that i can’t express any of those things very concisly. At first I tried to break it out into multiple patterns, but I found that that leads to documenting fundamental, well-known patterns.
What I am really trying to express is the interaction among a number of primitive patterns. Or a composite pattern. Alistair Cockburn documented the “Hexagonal Architecture” pattern as a design pattern, but without giving any real hints on the implementation. But what I’m trying to do is document an implementation of it in more detail.
I’m beginning to thing that this is an area where the object-oriented community is really failing. We all know that design patterns can help us build better systems, we know how to study and document patterns, but I think we haven’t gone far enough in figuring out how to apply patterns towards real-world problems. And it shows in the software we are producing. Simple patterns such a Singleton and Facade often appear in isolation because it is easy to see how to apply those patterns towards software problems. But what about more complex patterns like Chain of Responsibility. Although it is a very useful pattern, I don’t think most developers could see how to use it to solve real design problems.
At first I was thinking that the solution is a new type of “meta-pattern” that describes how patterns interact. But I think those patterns are going to be more abstract and harder to understand, not less so. Worse yet, they are likely not to be patterns at all, but simply descriptions of solutions to particular problems.
And that got me thinking: maybe we don’t need more patterns at all, but simply examples of successful real-solutions that use patterns. Other than for software I have personally worked on, I don’t think I have ever seen an complete description of the design of an actual working system. I have read numerous toy examples, I’ve read hundreds of “patterns” but I don’t know of any catalog of real solutions in the software literature.
Musicians study eachothers recordings, atheletes study videos of eachother in action, lawyers study cases, writers read eachothers work. Why then, don’t programmers study eachothers designs?