What it is not so good for

As a negative and a possible pitfall of the chain of responsibility design pattern, we will talk about the implementation involving partial functions. This is because it might not always be able to achieve what the developers want, and this could further complicate code and affect readability.

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.