The chain of responsibility design pattern

Nowadays, with the growth of data sizes and the hype around Big Data, stream processing is something that many applications will have to be able to do. Stream processing is characterized by an endless stream of data, which is passed from one object to another while each of them could be doing some processing and then passing it on to the next one. In other cases, data could be moved on in the chain until it arrives at an object which knows how to process a certain command.

The preceding behavior is really suitable for the chain of responsibility design pattern. The purpose of chain of responsibility is to:


Decouple the sender of a request from its receiver by giving multiple objects the chance to handle ...

Get Scala Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.