Skip to content

Commit 6b843f0

Browse files
committed
Commented chain of responsibility example.
1 parent 1cdb593 commit 6b843f0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

chain/src/main/java/com/iluwatar/App.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Chain of Responsibility organizes request handlers (RequestHandler) into
6+
* a chain where each handler has a chance to act on the request on its
7+
* turn. In this example the king (OrcKing) makes requests and the military
8+
* orcs (OrcCommander, OrcOfficer, OrcSoldier) form the handler chain.
9+
*
10+
*/
311
public class App
412
{
513
public static void main( String[] args )

chain/src/main/java/com/iluwatar/OrcKing.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Makes requests that are handled by the chain.
6+
*
7+
*/
38
public class OrcKing {
49

510
RequestHandler chain;

0 commit comments

Comments
 (0)