The chain of responsibility
We looked at the command design pattern in Chapter 1, Grokking the Functional Way. There, the sender and executor are decoupled. Taking the idea further, we could have a pipeline of command objects that are linked together in a list. As in command, the sender submits a request. However, the request could be handled by any of the command objects in the pipeline.
We talked of moms and their kids and of kids and their mums. So the dads of the world united and started feeling left out. No worries, there is a place under the Sun for dads too! Dads have big responsibilities of dealing with stuff, in a world-wise fashion. In a family, thus, we have roles and responsibilities. Dads are used to fix broken things around the house, cut firewood, hunt, fish, and sow the land. Moms cook, sew, and keep the house clean. Kids have a big business of growing up, and when they get some time away from their never-ending pranks, they study and play. And in an effort to make themselves...