forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iluwatar#90 Added comments for the example code.
- Loading branch information
Showing
10 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
front-controller/src/main/java/com/iluwatar/ArcherCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
package com.iluwatar; | ||
|
||
/** | ||
* | ||
* View for archers. | ||
* | ||
*/ | ||
public class ArcherView implements View { | ||
|
||
@Override | ||
|
5 changes: 5 additions & 0 deletions
5
front-controller/src/main/java/com/iluwatar/CatapultCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
front-controller/src/main/java/com/iluwatar/CatapultView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
package com.iluwatar; | ||
|
||
/** | ||
* | ||
* View for catapults. | ||
* | ||
*/ | ||
public class CatapultView implements View { | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
front-controller/src/main/java/com/iluwatar/ErrorView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.iluwatar; | ||
|
||
/** | ||
* | ||
* View for errors. | ||
* | ||
*/ | ||
public class ErrorView implements View { | ||
|
||
@Override | ||
public void display() { | ||
System.out.println("Error 500"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
front-controller/src/main/java/com/iluwatar/FrontController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
front-controller/src/main/java/com/iluwatar/UnknownCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
package com.iluwatar; | ||
|
||
/** | ||
* | ||
* Default command in case the mapping is not successful. | ||
* | ||
*/ | ||
public class UnknownCommand implements Command { | ||
|
||
@Override | ||
public void process() { | ||
System.out.println("Error 500"); | ||
new ErrorView().display(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters