Key Points

#1. We need to know design patterns to find solutions for frequently occurring problems. And we want to reuse these solutions whenever we face a similar situation in the future.

#2. These are one kind of template to address solutions in many different situations.

#3. In other words, these are the descriptions of how different objects and their respective classes solve a design problem in a specific context.

#4. Here we have discussed 23 design patterns as outlined by the Gang of Four. These patterns can be classified into three major categories:

  1. Creational Patterns:

    These patterns mainly deal with the instantiation process. Here we make the systems independent from how their objects are created, collected, or represented. The following five patterns fall into this category:

    • Singleton Pattern
    • Abstract Factory Pattern
    • Prototype Pattern
    • Factory Method Pattern
    • Builder Pattern
  2. Structural Patterns:

    Here we focus on how objects and classes are associated or can be composed to make relatively large structures. Inheritance mechanisms are mostly used to combine interfaces or implementations. The following seven patterns fall into this category:

    • Proxy Pattern
    • Flyweight Pattern
    • Bridge Pattern
    • Facade Pattern
    • Decorator Pattern
    • Adapter Pattern
    • Composite Pattern
  3. Behavioral Patterns:

    Here our concentration is on algorithms and the assignment of the critical responsibilities among the objects. We also need to focus on the communication between them. We need to take a closer look at the way those objects are interconnected. The following 11 patterns fall into this category.

    • Observer Pattern
    • Template Method Pattern
    • Command Pattern
    • Iterator Pattern
    • State Pattern
    • Mediator Pattern
    • Strategy Pattern
    • Chain of Responsibility Pattern
    • Visitor Pattern
    • Interpreter Pattern
    • Memento Pattern

#5. Here you can start with any pattern you like. I have chosen the simplest examples for your easy understanding. But you must think of the topic, practice more, try to link with other problems, and then ultimately keep doing the code. This process will help you, ultimately, to master the subject.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.200.14