Skip to content

Commit

Permalink
Added general-purpose Controller class (closes #10 )
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbozhko committed Jul 6, 2021
1 parent 805a38e commit 086be62
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package edu.summer.java;

import java.util.ResourceBundle;

/**
* Class Controller is general controller contains app flow logic.
* Contains references to:
* @see ResourceBundle
* @author Roman Bozhko
* @version 1.0
*/
public class Controller {
private final ResourceBundle bundle;

public Controller(ResourceBundle bundle) {
this.bundle = bundle;
}

public void runApp() {
new RecordController(bundle, new RecordView()).processInput();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import java.util.ResourceBundle;

/**
* Program entry point.
* Class with program entry point.
* @author Roman Bozhko
* @version 1.0
*/
public class Main {
public static void main(String[] args) {
new RecordController(ResourceBundle.getBundle("constants", new Locale(args[0])),
new RecordView()).processInput();
new Controller(ResourceBundle.getBundle("constants", new Locale(args[0]))).runApp();
}
}

0 comments on commit 086be62

Please sign in to comment.