A programming language independent strategies for solving the common object-oriented design problems. A design pattern represents an idea, not a particular implementation.
When should we use the design patterns?
We must use the design patterns during the analysis and requirement phase of SDLC (Software Development Life Cycle).
Categorization of Design Patterns:
- Creational Design Patterns: These patterns focus on object creation mechanisms, trying to create objects in a manner suitable for the situation. Some of the examples are: Factory Pattern, Abstract Factory Pattern, Singleton Pattern, Prototype Pattern, Builder Pattern.
- Structural Design Patterns: These patterns deal with object composition to form larger structures, while keeping the individual objects intact. Some of the examples are: Adapter Pattern, Bridge Pattern, Composite Pattern, Decorator Pattern, Facade Pattern, Proxy Pattern.
- Behavioural Design Patterns: These patterns focus on communication between objects, with the emphasis on how objects distribute responsibility. Some of the examples are: Command Pattern, Iterator Pattern, Observer Pattern, State Pattern, Strategy Pattern, Template Pattern.
Advantage of Design Pattern:
- They are reusable in multiple projects.
- They provide the solutions that help to define the system architecture.
- They provide transparency to the design of an application.