0

For any chaining implementation for puposes like piping (similar to Java servlet filter chain), if I need to, how do I pass context between filters?/steps?

Also, does it violate the design principle because now I am introducing states and coupling the chain steps using states. (One chain step depends on another step that introduces an attribute)

Should I be considering some other pattern to do the needful?

BenhurCD
  • 81
  • 1
  • 12
  • There's always setAttribute: https://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#setAttribute%28java.lang.String,%20java.lang.Object%29 – Not a JD Apr 04 '19 at 20:18
  • [ThreadLocal](https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html) could help too –  Apr 04 '19 at 22:43
  • Thanks. Just updated the question to know if the design makes sense – BenhurCD Apr 05 '19 at 03:40

0 Answers0