Practicing the Chain of Responsibility Pattern
page 1 of 8
Published: 21 Nov 2008
Abstract
The intent of the Chain of Responsibility pattern is to avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request and further, chain the receiving objects and pass the request along the chain until an object handles it. In this article, Xianzhong shows the typical utilization of another popular design pattern, the Chain of Responsibility pattern, by developing a simple application service explorer example with the help of relevant screen shots and source code. He begins with a detailed analysis of the various requirements for developing the sample application followed by an overview of the design. He further provides comprehensive coverage of the template method pattern and the various aspects of the sample application including some improvements which need to be done to the design.
by Xianzhong Zhu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 34255/ 103

Introduction

Digging further, there are included at least two meanings here. First, there are objects that have a common responsibility, which means these objects can be abstracted into a common interface. Secondly, it is the meaning of the "chain." The so-called "chain" from the angle of data structure, corresponds to the chain typed persisting structure, one of whose outstanding characteristics is that the factual elements are close together in the logical structure, while in the physical position not necessarily the case. Therefore, it is unlike an array that can be accessed at random. In the meantime, once any element in the chain becomes disjointed, the message delivered in the chain will be interrupted. Therefore, it will be a more comfortable way to provide a special class or method to carry out the responsibility of taking care of this chain of responsibility.

As you know, the ultimate purpose to introduce the Chain of Responsibility pattern is to achieve the aim of decoupling. And, from the angle of "encapsulate what varies," it seals the variety of responsibility behavior, in the meantime again, makes use of a chain structure to insure the deliver of news. All in all, the biggest advantage to introduce the Chain of Responsibility pattern lies in it can intelligently locate the suitable object in the responsibility chain according to specified conditions incumbency, and then the found object can carry out its responsibility.

In this article, I will show you the typical utilization of the Chain of Responsibility design pattern by building up a simple service explorer application with gradual modifications.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-10-22 6:41:10 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search