Chain of Responsibility Pattern: is it a good practice to have interdependent handlers?
- by wei
I have this scenario: I have a chain of query handlers, the first is to query the cache, if the cache can't answer it or the answer is stale, then hit a database, if it can't find the answer or the answer is stale again, then query a remote web service.
But I am not sure if this is the right way to use this pattern, since the work flow is pretty much fixed, and the cache and database handlers depend on the next step's return result to refresh its records.