How to use patterns

Although some of the previous criticisms are quite valid, they are based on how patterns are misused. Here is some advice that can help you understand how best to use design patterns:

  • Patterns are best used to communicate that you are following a well-understood design approach
  • Don't implement a pattern if your language supports a direct solution
  • Don't try to retrofit everything in terms of patterns
  • Use a pattern only if it is the most elegant solution in your context
  • Don't be afraid to create new patterns

Get Django Design Patterns and Best Practices - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.