Showing posts with label chain of responsibility. Show all posts
Showing posts with label chain of responsibility. Show all posts
11/14/2011
5/27/2011
Chain of Responsibility Pattern
Chain of responsibility patterns is used when we want to divide a control logic into pieces. The most common implementation is an email handler mechanism. In this mechanism, we will have an Handler interface and some classes implementing this Handler interface.
All requests will come to the first handler. After the first handler handles the requests whose rules are defined in its class, it will pass the control (remaining requests) to second handler. This flow will continue until all requests handled.
Ref: Head First Design Patterns
All requests will come to the first handler. After the first handler handles the requests whose rules are defined in its class, it will pass the control (remaining requests) to second handler. This flow will continue until all requests handled.
Sort the handlers from the most used to the least. By this way, unnecessary or least used ones will not work so often.
Ref: Head First Design Patterns
Subscribe to:
Posts (Atom)
