Skip to main content


Showing posts from November, 2009

Chain of responsibility pattern meets Spring, JPA, Wicket and Apache CXF part 1/2

Chain of responsibility behavioral design pattern is a wonderful solution for complex logic of processing a requests. In this pattern single request (message, database record, external system call, etc.) is being passed to the first handler in the chain. This handler can: process request and return result process request partially and run subsequent handler ignore the request and pass the control further as above run next handler and, after it returns, process already handled request simply return, without processing and passing control down the chain throw an exception Of course, if the first handler decides to pass control down the chain to the second one, the second handler has the same set of options. The most important feature of handlers is that each handler is only aware of itself – it does not know its position in chain (whether it is first, last or somewhere in the middle) and particularly not know what is the next handler down the chain. Because each handler is available on