Middleware: The Airport Checkpoints

When every endpoint starts by copying the same checks (log the request, make sure someone's signed in), one endpoint forgets one, and every new check is an edit to all of them; middleware gives each check its own small step in a line every request passes through, so each step handles the request or passes it on, which is Pass 3's Chain of Responsibility at work in every web framework.

By

Updated

Cheat sheet: Middleware: The Airport Checkpoints
Category
Data Structures
Level
Journeyman
Tags
Chain of Responsibility, Decorator Pattern, Middleware, OOP, software-development