The Chain of Responsibility design pattern provides a solution:
Define a chain of Handler objects having the responsibility to either handle a request or forward it to the next handler.
A class sends a request to a chain of handlers
and doesn't know (is independent of) which handler handles the request.
Describing Chain of Responsibility in more detail is the theme of the following sections.
See Applicability section for all problems Chain of Responsibility can solve.