Object-oriented design patterns are models that provide a solution to a common problem. These solutions have particular contexts to which they belong. So a pattern that solves one problem may not solve another. That is why I have created this ever-growing list of design patterns to help you become a better developer
You will probably find that you use some of these patterns in your daily development without ever realizing that they have a name. These names help developers discuss problems and solutions with a similar vocabulary improving communication. To discuss each pattern we will present a problem and a solution to help you understand the patterns better and to assist you in knowing when to use which pattern.
These patterns can be grouped into three categories: creational, structural, and behavioral.
Creational patterns are ones that generate instances of classes themselves rather than the developer directly instantiating them. This helps provide more flexibility by allowing the program to instantiate different objects depending on the situation.
- Singleton Pattern uses the class to statically hold on to its own instance. When asking for an instance the class returns the previously created instance or it creates a new one if none have been created.
Structural patterns are ones that focus on how objects inherit other objects and what functionality they have.
- Abstract Server uses abstractions for dependencies instead of concretions
Behavioral design patterns are focused on different objects communicate with each other.
- Active Object is an old technique for implementing multiple threads of control.