Skip to content

Commit 41f9fc4

Browse files
committed
refactor
1 parent d4fc6f9 commit 41f9fc4

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/main/java/helloworld/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package helloworld;
22

3-
import helloworld.behavioral.chain_of_responsibility.DesignPatternHandler;
4-
import helloworld.behavioral.chain_of_responsibility.HelloHandler;
3+
import helloworld.behavioral.chain_of_responsibility.HelloWorldObjectHandler;
4+
import helloworld.behavioral.chain_of_responsibility.HelloWorldInterjectionHandler;
55
import helloworld.behavioral.chain_of_responsibility.HelloWorldHandler;
66
import helloworld.behavioral.command.Command;
77
import helloworld.behavioral.command.HelloWorldPrintCommand;
@@ -92,7 +92,7 @@ public static void main(String[] args) throws InstantiationException, IllegalAcc
9292

9393
System.out.println("We are behavioral patterns!");
9494

95-
HelloWorldHandler helloWorldChainOfResponsibility = new HelloHandler().setNext(new DesignPatternHandler());
95+
HelloWorldHandler helloWorldChainOfResponsibility = new HelloWorldInterjectionHandler().setNext(new HelloWorldObjectHandler());
9696
System.out.println(helloWorldChainOfResponsibility.helloWorld());
9797

9898
Command helloWorldCommand = new HelloWorldPrintCommand();

src/main/java/helloworld/behavioral/chain_of_responsibility/HelloHandler.java renamed to src/main/java/helloworld/behavioral/chain_of_responsibility/HelloWorldInterjectionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @author yihua.huang@dianping.com
55
*/
6-
public class HelloHandler extends HelloWorldHandler {
6+
public class HelloWorldInterjectionHandler extends HelloWorldHandler {
77
@Override
88
public void handle(StringBuffer stringBuffer) {
99
stringBuffer.append("Hello ");

src/main/java/helloworld/behavioral/chain_of_responsibility/DesignPatternHandler.java renamed to src/main/java/helloworld/behavioral/chain_of_responsibility/HelloWorldObjectHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @author yihua.huang@dianping.com
55
*/
6-
public class DesignPatternHandler extends HelloWorldHandler {
6+
public class HelloWorldObjectHandler extends HelloWorldHandler {
77
@Override
88
public void handle(StringBuffer stringBuffer) {
99
stringBuffer.append("Chain of Responsibility!");

src/test/java/helloworld/behavioral/chain_of_responsibility/HelloWorldHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class HelloWorldHandlerTest {
1111

1212
@Test
1313
public void testHelloWorldHandler(){
14-
HelloWorldHandler helloWorldChainOfResponsibility = new HelloHandler().setNext(new DesignPatternHandler());
14+
HelloWorldHandler helloWorldChainOfResponsibility = new HelloWorldInterjectionHandler().setNext(new HelloWorldObjectHandler());
1515
assertThat(helloWorldChainOfResponsibility.helloWorld(),is("Hello Chain of Responsibility!"));
1616
}
1717
}

0 commit comments

Comments
 (0)