Design Patterns · Senior · Question 28 of 75

Why is the order of middleware or interceptors in a chain of responsibility risky?

Explanation

Token refresh must come before the retry, caching after authorization, error transformation at the end. The order should be set explicitly in one place and covered by tests.

Further reading

Problem with a question

Design Patterns · Senior · question 28

Test yourself

Take the Design Patterns · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz