Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Exceptions vs Context Objects

by idsfa (Vicar)
on Mar 31, 2006 at 19:55 UTC ( #540544=note: print w/replies, xml ) Need Help??

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.

The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540544]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-06-25 18:10 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.