Design patterns help you solve commonly-occurring problems in software design. But you can’t just find a pattern and copy it into your program, the way you can with off-the-shelf functions or libraries. A pattern is not a specific piece of code, but a general concept for solving a particular problem. They are like pre-made blueprints that you can customize to solve a recurring design problem in your code.
The book Dive Into Design Patterns illustrates 22 classic design patterns, and 8 design principles that these patterns are based on.
- Each chapter starts with a real-world software design problem, then solves it using one of the patterns.
- Then we dive into a detailed review of the pattern's structure and its variations, followed by a code example.
- Then the book shows various applications of the pattern and teaches how to implement the pattern step by step, even in an existing program.
- Each chapter concludes with a discussion of pros and cons of the pattern and explores its relations to, similarities with and differences from other patterns.