package de.pigeont.bowlinggame;

import java.util.logging.Level;
import java.util.logging.Logger;


public final class Bowling {
    private Bowling() {
    }
    public static void main(String[] args) {
        Configuration.init();
        Logger logger = Configuration.logger;
        logger.log(Level.INFO, "game started");

        try {
            createNewGame();

        } catch (Exception e) {
            logger.log(Level.SEVERE, "Exception: game terminated unexcepted", e);
            logger.log(Level.FINE, e.getMessage());
            System.exit(ReturnValue.FAILURE.getReturnCode());
        }
        System.exit(ReturnValue.SUCCESS.getReturnCode());
    }

    private static void createNewGame() {
        //all single object pattern and dependency injection
        GameController gcontroller = GameController.createController(Configuration.logger);
        GameStatusManager gm = GameStatusManager.createGameStatusManager(Configuration.logger);
        GameRender gr = GameRender.createRender(Configuration.logger);

        gcontroller.setStatusManager(gm);
        gcontroller.setGameRender(gr);

        gm.setGameController(gcontroller);
        gr.setController(gcontroller);

        gcontroller.startNewGame();
    }

    enum ReturnValue {
        SUCCESS(0),
        FAILURE(1);

        private int returnCode;

        ReturnValue(int returnCode) {
            this.returnCode = returnCode;
        }

        public int getReturnCode() {
            return returnCode;
        }
    }
}
@@ -148,24 +148,25 @@
 g() %7B%0A    %7D%0A
+%0A
     public s
@@ -366,17 +366,16 @@
 Game();%0A
-%0A
         
@@ -1028,24 +1028,42 @@
 n.logger);%0A%0A
+        try %7B%0A    
         gcon
@@ -1092,16 +1092,20 @@
 er(gm);%0A
+    
         
@@ -1131,25 +1131,28 @@
 Render(gr);%0A
-%0A
+    
         gm.s
@@ -1178,24 +1178,223 @@
 ontroller);%0A
+        %7D catch (ReassignmentException e) %7B%0A            Configuration.logger.log(Level.WARNING,%0A                    %22reassignment of bowling component, all the component is immutable%22, e);%0A        %7D%0A
         gr.s

clean codes