in reply to Exceptions vs Context Objects
I've seen a completely different approach to this problem in servlet filter chains (danger, java example). In this model, you create a container which holds the ordered list of steps. You can either do this with a linear model or a nested model.
In the linear model, an iterator over the container calls the first step, checks the results to see if it should continue, and passes the output to the next step until it is done. Pipeline is an implementation of this.
The java example above illustrates the nested model. Each step is passed the chain object, and is required to call the next step on the chain if and when it is ready to. In some implementations, it could also skip some or all of the remaining steps. In this model, each step is effectively nested inside the previous steps.
|
|---|