Chain of Responsibility Pattern: is it a good practice to have interdependent handlers? -


I have this scenario: I have a series of query handlers, first to query the cache, if the 'cache' Answer or Reply is stale, then hit a database, if he can not find the answer or the answer can be repetitive, then ask a remote web service

but I'm not sure that using this method This is the right way to do, because the flow of work is pretty much fixed, and the cash and The database handler relies on the result of the next step to refresh its record.

Whatever you are talking about is not strictly speaking, the chain of responsibility patterns is. It seems as if you are implementing a cache, if you are implementing a cache, the scenario you have described is OK. If you are looking for the right chain of responsibility, then it is not so.


Comments