Software Design

Chain of Responsibility for HTTP Middleware

UML Class Diagrams · made in Skemio

UML class diagram illustrating the Chain of Responsibility pattern with HttpHandler base class and Auth, RateLimit, and Validation subclasses.
UML class diagram illustrating the Chain of Responsibility pattern with HttpHandler base class and Auth, RateLimit, and Validation subclasses.

What it shows

  • Each middleware handler decides to process, reject, or forward the request.
  • Adding new cross-cutting checks requires zero edits to existing handlers.
  • Order matters: cheap checks like Rate Limiting run before costly Auth DB queries.

The takeaway

Pipeline request validation by chaining discrete handlers that point to the next link.

More uml class diagrams