Chain of responsibility — RexDac Academy

RexDac AcademyTechnical notes · Some prior knowledge helps
0%Published notes read · this device

Principles and Architecture / Design patterns / Behavioral

Chain of responsibility

Original notes by SunDiaL · View English source

The problem: Your code becomes messy because of a lot of checks you must do before getting to the important part. The solution: Extract each check/step in a separate "handler" class.

An example: The middleware pipeline in a Web API.