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

Posted by wei on Stack Overflow See other posts from Stack Overflow or by wei
Published on 2010-05-16T22:55:06Z Indexed on 2010/05/16 23:00 UTC
Read the original article Hit count: 205

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.

© Stack Overflow or respective owner

Related posts about chain-of-responsibility