Design patterns are reusable solutions. These typically involve a small set of classes co-operating to achieve some desired goal. These are basically high level programming abstractions.

The main benefits of design patterns are:

  • Leveraging existing knowledge
  • Shared vocabulary
  • Flexibility for change (maintainability and edit-ability)
  • The common goal here is to improve cohesion and reduce coupling

Categories

Design patterns are typically grouped into:

Over Engineering

Overusing design patterns can lead to system bloat and make code harder to understand, use simple code instead.

Summary

  • Design for the system you need today
  • Revisit the design periodically for opportunities to refactor and improve

The opposite of design patterns are Code Smells (also see Test Anti Patterns).