Chapter 10: Behavioral Patterns
In this chapter, we explore two new design patterns from the well-known Gang of Four (GoF). Those are behavioral patterns, which means that they help simplify the management of system behavior.
The following topics will be covered in this chapter:
- Implementing the Template Method pattern
- Implementing the Chain of Responsibility pattern
- How to mix both
Implementing the Template Method pattern
The Template Method is a GoF behavioral pattern using inheritance to share code between the base class and its subclasses. It is a very powerful, yet simple, design pattern.
Goal
The goal of the Template Method pattern is to encapsulate the outline of an algorithm in a base class while leaving some parts of that algorithm ...
Get An Atypical ASP.NET Core 5 Design Patterns Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.