This Repo to discuss some design patterns which provides a general reusable solution for the common problems that occur in software design.
- A design pattern provides a general reusable solution for the common problems that occur in software design.
- The pattern typically shows relationships and interactions between classes or objects.
- 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 design patterns, you can make your code more flexible, reusable, and maintainable.
- Understand the purpose and usage of each design pattern in order to pick and implement the correct pattern.
- In many real-world situations, we want to create only one instance of a class. For example, there can be only one active president of a country at any given time. This pattern is called a Singleton pattern.
- Other software examples could be a single DB connection shared by multiple objects as creating a separate DB connection for every object is costly. Similarly, there can be a single configuration manager or error manager in an application that handles all problems instead of creating multiple managers.
-
- These 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.
-
- These design patterns are about organizing different classes and objects to form larger structures and provide new functionality.
-
- Behavioral patterns are about identifying common communication patterns between objects and realizing these patterns.