Sometimes we have a lot of problems when we design some projects, so that’s why the design patterns it’s a real option to solve this kind of problems, but why?
Design Patterns provides a general reusable solution for this commons mistakes. The patterns typically show relationships and interactions between classes or objects. The idea is to speed up the development process by providing well tested, proven development/design paradigm. Design patterns are programming language independent strategies for solving a common problem. That means a design pattern represents an idea, not a particular implementation. By using the design patterns you can make your code more flexible, reusable and maintainable.Design Patterns provides a general reusable solution for this commons mistakes.
Types of Design Patterns
There are mainly three types of design patterns:
Creational
These design patterns are all about class instantiation or object creation. These patterns can be further categorized into Class-creational patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done. Creational design patterns are the Factory Method, Abstract Factory, Builder, Singleton, Object Pool, and Prototype.
Structural
These design patterns are about organizing different classes and objects
to form larger structures and provide new functionality.
Structural design patterns are Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Private Class Data, and Proxy
Behavioral
Behavioral patterns are about identifying common communication patterns between objects and realize these patterns.
Behavioral patterns are Chain of responsibility, Command, Interpreter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template method, Visitor
If you are interested to know more about this you can check this page and this book
https://sourcemaking.com/design_patterns
https://www.geeksforgeeks.org/observer-pattern-set-2-implementation/