Commented chain of responsibility example.
This commit is contained in:
parent
1cdb59352d
commit
6b843f028a
@ -1,5 +1,13 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Chain of Responsibility organizes request handlers (RequestHandler) into
|
||||||
|
* a chain where each handler has a chance to act on the request on its
|
||||||
|
* turn. In this example the king (OrcKing) makes requests and the military
|
||||||
|
* orcs (OrcCommander, OrcOfficer, OrcSoldier) form the handler chain.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class App
|
public class App
|
||||||
{
|
{
|
||||||
public static void main( String[] args )
|
public static void main( String[] args )
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Makes requests that are handled by the chain.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class OrcKing {
|
public class OrcKing {
|
||||||
|
|
||||||
RequestHandler chain;
|
RequestHandler chain;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user