Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reduces checkstyle errors in front-controller
  • Loading branch information
anuragagarwal561994 committed Nov 11, 2019
commit 9371a38870534c41e017290a61f61db40a02a7d4
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,27 @@
package com.iluwatar.front.controller;

/**
*
* The Front Controller is a presentation tier pattern. Essentially it defines a controller that
* handles all requests for a web site.
* <p>
* The Front Controller pattern consolidates request handling through a single handler object (
*
* <p>The Front Controller pattern consolidates request handling through a single handler object (
* {@link FrontController}). This object can carry out the common the behavior such as
* authorization, request logging and routing requests to corresponding views.
* <p>
* Typically the requests are mapped to command objects ({@link Command}) which then display the
*
* <p>Typically the requests are mapped to command objects ({@link Command}) which then display the
* correct view ({@link View}).
* <p>
* In this example we have implemented two views: {@link ArcherView} and {@link CatapultView}. These
* are displayed by sending correct request to the {@link FrontController} object. For example, the
* {@link ArcherView} gets displayed when {@link FrontController} receives request "Archer". When
* the request is unknown, we display the error view ({@link ErrorView}).
*
* <p>In this example we have implemented two views: {@link ArcherView} and {@link CatapultView}.
* These are displayed by sending correct request to the {@link FrontController} object. For
* example, the {@link ArcherView} gets displayed when {@link FrontController} receives request
* "Archer". When the request is unknown, we display the error view ({@link ErrorView}).
*/
public class App {

/**
* Program entry point
*
* @param args
* command line args
* Program entry point.
*
* @param args command line args
*/
public static void main(String[] args) {
FrontController controller = new FrontController();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Custom exception type
*
* Custom exception type.
*/
public class ApplicationException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Command for archers.
*
*/
public class ArcherCommand implements Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
import org.slf4j.LoggerFactory;

/**
*
* View for archers.
*
*/
public class ArcherView implements View {

private static final Logger LOGGER = LoggerFactory.getLogger(ArcherView.class);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Command for catapults.
*
*/
public class CatapultCommand implements Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import org.slf4j.LoggerFactory;

/**
*
* View for catapults.
*
*/
public class CatapultView implements View {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Commands are the intermediary between requests and views.
*
*/
public interface Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import org.slf4j.LoggerFactory;

/**
*
* View for errors.
*
*/
public class ErrorView implements View {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
package com.iluwatar.front.controller;

/**
*
* FrontController is the handler class that takes in all the requests and renders the correct
* response.
*
*/
public class FrontController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Default command in case the mapping is not successful.
*
*/
public class UnknownCommand implements Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
package com.iluwatar.front.controller;

/**
*
* Views are the representations rendered for the user.
*
*/
public interface View {

Expand Down