Created
December 5, 2012 18:11
-
-
Save vilmosioo/4218054 to your computer and use it in GitHub Desktop.
Controller concept as a singleton object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Singleton pattern to ensure a single controller | |
*/ | |
private static MainController controller = null; | |
public static synchronized MainController Current() { | |
if (controller == null) { | |
controller = new MainController(); | |
} | |
return controller; | |
} | |
private MainController() { | |
initialise(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment