Overview of Design Patterns
There are more than 50 identified Design Patterns. There are 4 main categories of Design Patterns: Creational, Structural, Behavioral, and Concurrency Patterns.
Creational Design Patterns: Software designs/solutions become complex due to high number of objects created. Creational Design Patterns control the object creation process. The systems become too rigid if they are composed with inheritance without consideration. Creational Design Patterns aims at breaking this close coupling.
Structural Design Patterns: They are aimed at finding easier ways to establish relationships between entities (objects). They are used to specify the methods which connect objects, and are static to some extent. It means they also govern how data is structured in a structure. Structural design patterns often use inheritance to combine interfaces and implementation of multiple classes.
Behavioral Patterns: These identify common communication patterns between objects. They are used to decouple code from clients. Less coupling means less time spent on debugging/modifying the code. Callback functions serve the purpose of decoupling code from clients. (If you don’t know what callback functions are read this. Parent class attach a hook on one of the child’s event.) State Machines can be created and managed with Behavioral Patterns
Concurrency Patterns: They are targeted at achieving parallelism so that multiple tasks can be performed simultaneously. However, the benefits of using the concurrency patterns should outweigh the overall cost. In other words, too many parallel threads/tasks can increase overall time of execution because of high context switching and scheduling.