X Tutup
Skip to content

Commit c5c4a68

Browse files
committed
iluwatar#107 Front Controller example JavaDoc
1 parent de784cf commit c5c4a68

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

front-controller/src/main/java/com/iluwatar/front/controller/App.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@
44
*
55
* The Front Controller is a presentation tier pattern. Essentially it defines a
66
* controller that handles all requests for a web site.
7-
*
7+
* <p>
88
* The Front Controller pattern consolidates request handling through a single handler
9-
* object (FrontController). This object can carry out the common the behavior such as
9+
* object ({@link FrontController}). This object can carry out the common the behavior such as
1010
* authorization, request logging and routing requests to corresponding views.
11-
*
12-
* Typically the requests are mapped to command objects (Command) which then display
13-
* the correct view (View).
14-
*
15-
* In this example we have implemented two views: ArcherView and CatapultView. These
16-
* are displayed by sending correct request to the FrontController object. For example,
17-
* the ArcherView gets displayed when FrontController receives request "Archer". When
18-
* the request is unknown, we display the error view (ErrorView).
11+
* <p>
12+
* Typically the requests are mapped to command objects ({@link Command}) which then display
13+
* the correct view ({@link View}).
14+
* <p>
15+
* In this example we have implemented two views: {@link ArcherView} and {@link CatapultView}. These
16+
* are displayed by sending correct request to the {@link FrontController} object. For example,
17+
* the {@link ArcherView} gets displayed when {@link FrontController} receives request "Archer". When
18+
* the request is unknown, we display the error view ({@link ErrorView}).
1919
*
2020
*/
2121
public class App {
2222

23+
/**
24+
* Program entry point
25+
* @param args command line args
26+
*/
2327
public static void main(String[] args) {
2428
FrontController controller = new FrontController();
2529
controller.handleRequest("Archer");
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package com.iluwatar.front.controller;
22

3+
/**
4+
*
5+
* Custom exception type
6+
*
7+
*/
38
public class ApplicationException extends RuntimeException {
49

5-
public ApplicationException(Throwable cause) {
10+
private static final long serialVersionUID = 1L;
11+
12+
public ApplicationException(Throwable cause) {
613
super(cause);
714
}
815
}

front-controller/src/test/java/com/iluwatar/front/controller/AppTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
import com.iluwatar.front.controller.App;
66

7+
/**
8+
*
9+
* Application test
10+
*
11+
*/
712
public class AppTest {
813

914
@Test

0 commit comments

Comments
 (0)
X Tutup