+
Point of view
All features
deferred class CHAIN_OF_RESPONSIBILITY
Summary
The Chain Of Responsibility Design Pattern reified. Such a chain is made of handlers you can add or remove at your leisure.
The Chain itself is a Command (see that Design Pattern). Executing that command looks for a handler that can handle a request, and let it handle that request.
How you do implement the query is up to you. The handlers are given Current i.e. the Chain itself, and CHAIN_HANDLER is a generic class so you can implement your own protocol.
Direct parents
Inherit list: COMMAND
Class invariant
Overview
Features
{ANY}
  • add (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY])
    Add a handler to the Chain.
  • remove (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY])
    Remove a handler from the Chain.
  • has (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY]): BOOLEAN
    Does the handler belong to the chain?
{ANY}
  • execute
    Find a suitable handler to handle a request.
{}
  • chain: FAST_ARRAY[CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY]]
add (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY])
effective procedure
{ANY}
Add a handler to the Chain.
remove (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY])
effective procedure
{ANY}
Remove a handler from the Chain.
require
has (c: CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY]): BOOLEAN
effective function
{ANY}
Does the handler belong to the chain?
execute
effective procedure
{ANY}
Find a suitable handler to handle a request.
chain: FAST_ARRAY[CHAIN_HANDLER[CHAIN_OF_RESPONSIBILITY]]
writable attribute
{}