Behavioral desing pattern is concerned communication between objects. Lets look at some of the examples of Behavioral pattern in this article.
Chain of responsibility desgin pattern:
The chain of responsibility pattern is used to achieve loose coupling in software where a
specified request from the client is passed through a chain of objects included in it. It helps in
building a chain of objects. The request enters from one end and moves from one object to another.Let’s look at an example below:
Output:
Observer desgin pattern:
In this pattern, objects are represented as observers that wait for an event to trigger.Let’s look at an example below:
Output:
Conclusion
In conclusion, it is always a good idea to know about software design patter because it let’s us find solution to common problem in efficient way.
There are some criticism of design pattens as well. As an avid reader we should be aware of both the positive and negative aspect of design pattern. As quoted in Wikepedia one criticism is layed out as “ A primary criticism of Design Patterns is that its patterns are simply workarounds for missing features in C++, replacing elegant abstract features with lengthy concrete patterns, essentially becoming a “human compiler” or “generating by hand the expansions of some macro””
There are other criticism as well but as a developer it’s more fruitful to know about these design pattern concepts as they are commonly used in day to day life.
You can also search for more patter implementation in the web as this article has only some major ones.