Common causes of Redesign
Accordingly to GoF Design Patterns book:
- Creating a class by specifying a class explicitly : If need be use creational patterns instead
- Dependence on specific methods : If need be use Chain of Responsibility or Command pattern instead
- Dependence on Hardware and/or software platforms : Consider using Abstract Factory or Bridge pattern instead
- Dependence on Object Representation or Implementation : Must program to interface and not to implementation. Abstract Factory, Bridge, Memento, Proxy etc patterns can help.
- Dependence on specific Algorithms : Consider using Strategy or Visitor pattern
- Extending functionality by subclassing : Prefer composition over inheritance
- Inability to alter classes conveniently : esp. with third party libraries. Adapter, Decorator and Visitor can help.
What’s surprising is that decades ago people knew about these problems, but still pretty much every system has these problems. What are they doing that these anti-patterns are so sustainable?