October 2018
Intermediate to advanced
370 pages
9h 15m
English
The chain of responsibility pattern is an alternative version of the if { ... } else if { ... } else if { ... } else block. According to this pattern, we have a source of request objects and a chain of processing objects. A processing object that can't handle a request passes it to another handler. The following diagram demonstrates this:

The preceding diagram contains the Request interface that is implemented by the DELETERequest, PUTRequest, POSTRequest, and GETRequest classes. The RequestHandler interface is implemented by the DELETERequestHandler, POSTRequestHandler, PUTRequestHandler, and DELETERequestHandler
Read now
Unlock full access