|
Annex B: Design PatternsB3. Chain of ResponsibilityDescriptionWhen several objects are likely to be able to treat a request according to the context, this pattern allows to avoid the direct coupling between the sender of the request and its processing by one of the potential receivers. A chain of receiving objects then is made up and traversed until one of them handles the request. Structure and Components
Structure and Components of the Chain of Responsibility design pattern
CollaborationsThe request sent by the client is transmitted along the chain until its effective processing.
Collabotations of the Chain of Responsibility design patternStrengths and Weaknessesreduction of the coupling between the client and the processing of a request by a set of objects which do not know in advance which effectivelly will be handling the request, possibility of dynamically modifying the way of handling a request, flexibility in the allocation of the responsibilities for handling in the objects of processing, following to the constraints of design, the processing can not be guaranteed. Use in CBR*ToolsA design of retain uses this pattern to make the decision of the addition of a case and its indexing into the memory. A chain of decision-makers is then formed, in which each element prepares according to a criterion the response to this request. Brigitte Trousse Last modified: Fri Sep 28 13:51:31 MEST 2001 |