|
|
|
|
|
by mironathetin
5440 days ago
|
|
... architecture astronauts who hijacked the language in the last decade - J2EE/EJB, the GoF ... Thank you for writing this.
When I first read the GoF Design Pattern Book I thought "this is the reason, why the code in my project is bloated,
unmaintainable and shitty". |
|
Not sure if you know the history, but the authors of the book really only collected the patterns that they had seen around them in Smalltalk and C++ code. They wrote a catalog so we could all refer to the same name instead of using different names for the same concept. They identified the common problems that these patterns tried to solve and they also identified the trade-offs. Oh yes, they identified trade-offs!
Unfortunately, many developers thought that they had to put as many patterns as possible in their code, which was not the intent of the GoF. Ralph Johnson said that they received emails like "I have now used 15 patterns in my project, do you think we should use more?"
Andrzej mentions in his blog post that Java (and C++) lacks dynamic capabilities so this is why sometimes, you need these design patterns to make your code more easily extendable. Other patterns are good even with dynamic languages (observers...).