AlgoViz

Chain of responsibility

medium 45 min

A request travels past several handlers until one takes it, or until one stops it.

Watch lesson4:36

Explain your choices

Answer first. Then compare your reasoning.

15 questions 0 got it 0 to review15 not marked

Defend

Choice, reason, cost, trigger

ChoiceReasonCostI would change it when
List and runnerHandlers do not know each otherNo work after the restA link must wrap, then compose functions
Catch-all at the endNothing is lostHides missing rulesMissing rules are bugs, then an exception
canHandle apart from resolveCan be asked without effectsThe condition may be computed twiceIt is expensive, then one method with an outcome
Fail closed for securityNo hole under failureAn outage stops salesNever for permission, sometimes for fraud score
Immutable chainNo half changesA new list per changeNever