Do You Recognise the 4 Early Warning Signs of Design Pattern Abuse?
Software design patterns represent a flexible and elegant means of applying object oriented design to particular types of problems, irrespective of the domain they are situated in. This is the beauty, and the lure, that causes so many programmers to slip into a pattern of their own whereby they get used to applying these patterns to simple problems when they are not needed. It’s just a natural thing that happens over time with extensive use of patterns (I know I’ve run into this problem before).
Each pattern describes a problem which occurs over and over again in our environment, and then descries the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice. – Christopher Alexander
Software design patterns can and do lead to over-engineering
Over-engineering is the process of over complicating something. In the case of programming, making your code more complex and possibly more flexible than it needs to be. More specifically, implementing complex software design patterns on simple problems.
1. Start simple not complex
How does this happen? Usually you program in extra functionality that you anticipate will be used or prove to be useful later. But what happens if this need never materialises? In most cases, the cruft gets left there. It doesn’t get removed. So the software system continues to grow in size and complexity with all these features that aren’t ever being used.
2. Be wary of the signs
This is perhaps different for everyone but I suspect in most cases, it isn’t really a conscious effort. But rather, it is something brought about by the fear of being stuck with an awkward, inelegant, inappropriate or simply put, bad design; being stuck with something that just isn’t flexible enough. Ironically, if you get to the point of over engineering or over applying patterns you are right back where you started.
Software design patterns appeal to programmers or developers because they allow them to naturally express and create beautiful architectures. It’s a part of enjoying creative programming.
3. Consider refactoring to a pattern rather than starting from one
What might be a good way to avoid this design pattern abuse? Consider refactoring to a pattern rather than starting from one. Don’t start out trying to force a pattern into your design. Chances are your design could be much simpler without it. If you do find at a later stage that your design truly could benefit from a structured pattern, then refactor to allow for it. When you design, solve the problem in the simplest way possible. Simple light weight software is always a good thing.
There are better ways of avoiding the under-engineered alternative where you get stuck with a design or solution that just isn’t flexible enough or doesn’t suit the problem.
4. Don’t force yourself to get it right the first time
Forcing software design patterns or structures into design just isn’t the answer, that’s just bad design. But prototyping or building an initial build0 (proof of concept build before production on the actual product begins) can help avoid this and the problem of over-engineering. Because you don’t feel like you have to get it perfectly right the first time.
If you are interested in design patterns an excellent book I’d recommend is - <em>”Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series)”

February 15th, 2007 at 1:44 pm
[...] The size of your software solutions matters. As a developer, you should always be conscious of the effects that size and complexity have on development and what it translates into. In past articles I have looked at the early warning signs of design pattern abuse, how to better choose design patterns that fit and ways to improve your software design by keeping it simple. In this article I explore why you should consciously think about what you code and provide solid benefits for why you should produce smaller code. [...]
November 28th, 2008 at 2:57 am
[...] early warning signs of design pattern abuse [...]