Design patterns are typical solutions to commonly occurring problems in software design. You can’t just find a pattern and copy it into your program, the way you can with off-the-shelf functions or libraries. The 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. - Every chapter starts from a discussion of a real life software design problem which is then progressively solved by applying one of the patterns. - Then goes a detailed review of the pattern’s structure and its variations, followed by a code example. - Then the books 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 its relations, similarities and differences with other patterns. A Few Words on Copyright......Page 3 Table of Contents......Page 5 How to Read This Book......Page 7 INTRODUCTION TO OOP......Page 8 Objects, classes......Page 9 Class hierarchies......Page 11 Abstraction......Page 14 Encapsulation......Page 15 Inheritance......Page 18 Polymorphism......Page 19 Relations Between Objects......Page 21 INTRODUCTION TO PATTERNS......Page 24 What’s a Design Pattern?......Page 25 Why Should I Learn Patterns?......Page 29 SOFTWARE DESIGN PRINCIPLES......Page 30 Features of Good Design......Page 31 Design Principles......Page 35 Encapsulate What Varies......Page 36 Program to an Interface, not an Implementation......Page 40 Favor Composition Over Inheritance......Page 45 SOLID Principles......Page 49 Single Responsibility Principle......Page 50 Open/Closed Principle......Page 52 Liskov Substitution Principle......Page 55 Interface Segregation Principle......Page 62 Dependency Inversion Principle......Page 65 CATALOG OF DESIGN PATTERNS......Page 69 Creational Design Patterns......Page 70 FACTORY METHOD......Page 72 ABSTRACT FACTORY......Page 88 BUILDER......Page 104 PROTOTYPE......Page 123 SINGLETON......Page 137 Structural Design Patterns......Page 146 ADAPTER......Page 150 BRIDGE......Page 163 COMPOSITE......Page 178 DECORATOR......Page 192 FACADE......Page 210 FLYWEIGHT......Page 220 PROXY......Page 234 Behavioral Design Patterns......Page 246 CHAIN OF RESPONSIBILITY......Page 251 COMMAND......Page 269 ITERATOR......Page 290 MEDIATOR......Page 305 MEMENTO......Page 321 OBSERVER......Page 337 STATE......Page 353 STRATEGY......Page 369 TEMPLATE METHOD......Page 382 VISITOR......Page 394 Conclusion......Page 410