Multistage Processing

Learn which design patterns to use when multistage processing is needed.

Problem statement

Let’s imagine that we need to implement a logic that requires multiple stages of processing, possibly involving conditional logic.

One example of this would be a validation of HTTP requests. First, we might want to see whether the incoming request matches any allowed paths in our application. Then, we might want to check whether the user is authenticated. After that, we might want to check whether the user is allowed to access the particular resource that the request was made for.

In this situation, we ...