Band of four design patterns
Over a decade ago Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, known as the Gang of Four (GoF), released their flagship book “Design Patterns: Elements of Reusable Object-Oriented Software” . The GoF book, which is seen as the harbinger of the entire software model movement, has recently been criticized as no longer relevant, solving problems that are better addressed by newer languages and introducing complexity. useless.
It all started earlier this month when Jeff Atwood (Coding Horror) criticized the GoF Design Templates delivered. Jeff wrote that while he thinks the book should be read by all programmers, he still has two main issues with the book:
1. Design patterns are a form of complexity. As with any complexity, I prefer to see developers focus on simpler solutions before jumping straight into a complex recipe of design models.
2. If you frequently find yourself writing a bunch of standard design pattern code to deal with a “recurring design problem”, that’s not good engineering – it’s a sign that your language is fundamentally broken. .
Jeff also quotes Mark Dominus who thinks that the GoF book obstructs ideas by Christopher Alexander et al. who wrote the book of architecture (of the building) “A model language – cities, building construction“(which is considered the inspiration for the entire movement of design models in computer science)
Steve Rowe agrees that the models should be used as examples of good design and principles to be applied and not as a reference book but he says that Jeff is irrelevant because he attacks the concept instead of how the blame is on the people who apply them wrongly. He concludes that models should be treated as examples of good design and not as dogma:
Design models are very useful when we study how they work in order to create similar models. They are bad when you try to copy them directly. If one reads The Gang of Four, he will realize that the authors often give several examples of each model and that they are all slightly different. It can also be noticed that there is a lot of discussion about OO concepts that lead to models.
Cedric Otaku responds to both Jeff’s and Mark’s criticisms in an article he titled “In defense of Design Patterns“. Cedric says that Jeff (and Mark before him) are wrong to criticize the GoF book, without offering an alternative. Cedric goes on to explain the problem of drawing a parallel between Alexander’s construction design model and the software design templates
There’s a reason it’s important to make a clear separation between Alexander’s Design Patterns and GOF’s Design Patterns: Software engineering is nowhere near as advanced as building engineering. We’re still working on those nuts and bolts, and every time a new software project starts up, we still can’t be sure that it won’t collapse under its own weight after just a year. To draw a parallel: imagine a world where every time a new construction takes place (say, a bridge), the future of that bridge depends on the team of engineers and workers you choose to build it. .
Cedric says this because the construction is much more advanced (in its predictability and stability) than the software. we are still fighting for the basics and we should focus on that.
On the other hand an Aristotle Pagaltzis left a comment on Cédric’s blog and rationalized Mark’s criticism.
Dominus says that the design patterns are a sign of a language deficiency in the purpose of the design pattern. In other words, the Visitor model used in Java indicates that Java is deficient in terms of list processing: the `map` and` filter` constructs must be emulated with long OO incantations.
It does _not_ say that the use of design templates _as such_ is bad. He says they are a sign of a disability.
It seems that most (if not all) agree that models as a tool in software engineering are useful, the debate is about the value of the GoF book today. What do you think ? Are Gof Design Patterns a timeless piece or have they outlived their usefulness?