The purpose of the chain of responsibility design pattern involves senders and receivers. Specifically, the chain of responsibility design pattern calls for the decoupling of the sender and receiver. Objects can be sent to a series of receivers without the sender being concerned about which receiver handles the request. The request is sent along a chain of receivers and only one of them will process the request. Let's look at some examples of this.
Consider a large customer service agency that handles thousands of incoming emails each day. Instead of having a person or persons manually review each one to determine which department should process the email, we can write a Java program using the chain of responsibility design pattern to send the emails along the chain so that they are processed by the appropriate department...