10
Behavioral Patterns
In this chapter, we explore two new design patterns from the well-known Gang of Four (GoF). They are behavioral patterns, which means that they help simplify the management of system behaviors.
Often, you need to encapsulate some core algorithm while allowing other pieces of code to extend that implementation. That is where the Template Method pattern comes into play.
Other times, you have a complex process with multiple algorithms that all apply to one or more situations and you need to organize it in a testable and extensible fashion. This is where the Chain of Responsibility pattern can help. For example, the ASP.NET Core middleware pipeline is a Chain of Responsibility where all the middleware inspects the request ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access