In software engineering, a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
For example, to create a class for which only a single instance should be created and that single object can be used by all other classes, we can use Singleton design pattern.
Design patterns were originally grouped into the categories: creational patterns, structural patterns, and behavioral patterns.
These patterns mainly deal with the instantiation process.
Here we make the systems independent from how their objects are created, collected, or represented.
Here we focus on how objects and classes are associated or can be composed to make relatively large structures.
Behavioral patterns are concerned with the assignment of responsibilities between objects, or, encapsulating behavior in an object and delegating requests to it.
- Observer Pattern
- Command Pattern
- Iterator Pattern
- Template Method Pattern
- State Pattern
- Interpreter Pattern Example