diff --git a/src/main/java/calculator/Application.java b/src/main/java/calculator/Application.java index 7abdbe3dad..36d4b3fe83 100644 --- a/src/main/java/calculator/Application.java +++ b/src/main/java/calculator/Application.java @@ -4,7 +4,7 @@ import calculator.controller.CalculatorController; public class Application { - private static final Configuration configuration = new Configuration(); + private static final Configuration configuration = Configuration.getInstance(); public static void main(String[] args) { CalculatorController calculatorController = configuration.getCalculatorController(); diff --git a/src/main/java/calculator/config/Configuration.java b/src/main/java/calculator/config/Configuration.java index 6bb996f606..5854292068 100644 --- a/src/main/java/calculator/config/Configuration.java +++ b/src/main/java/calculator/config/Configuration.java @@ -4,10 +4,14 @@ import calculator.service.CalculatorService; public class Configuration { - private final CalculatorController calculatorController; + private static final Configuration configuration = new Configuration(); + private final CalculatorController calculatorController = new CalculatorController(); - public Configuration() { - this.calculatorController = new CalculatorController(); + private Configuration() { + } + + public static Configuration getInstance() { + return configuration; } public CalculatorController getCalculatorController() {