Do We Need Design Patterns?
In the previous week I have been asked “do we really need design patterns
when we write code?”. Since one of the first things that I wrote in my blog
was a design patterns series you probably would think that I answered SURE!
or other absolute answer.
That isn’t the case.
The question was raised since I saw that a developer tried to enforce a
design pattern (abstract factory) that wasn’t needed in some place in the
code. What I really believe in is that design patterns are guidelines
of how to build better object oriented design but…
sometime it is being abused like every other aspect in programming.
You don’t need to enforce a pattern in code if what you only need is very
simple implementation.
Yes, reusability, scalability and other phrases that are connected to design
patterns are very important but so does simplicity or other
object oriented design principals like S.O.L.I.D.
In conclusion, we need design patterns but there are other things to consider
when you develop an application. To write it in other words –
“When the only tool you have is a hammer, it is tempting to treat everything as
if it were a nail” - Abraham Maslow.