I am refactoring the code for a music player I wrote in Java/JavaFX. I have a few key objects which are accessed throughout the program by various other classes. I think there will be four or five by the time I finish moving everything around. There is only ever one instance of these objects instantiated for the life of the program.Is this approach to making these key Objects easily available when needed good architecture? Is there a better approach to this issue?public class Hypnos extends Application {    private static AudioPlayer player;    private static FXUI gui;    private static Library library;    private static Queue queue;    ...     public static AudioPlayer getPlayer() {         if ( audioPlayer == null ) {            throw new IllegalStateException();        }        return player;    }    public static FXUI getGUI() {        if ( ui == null ) {            throw new IllegalStateException();        }        return gui;    }    //etc     @Override    public void start ( Stage stage ) {        ...        library = new Library();        queue = new Queue();        player = new AudioPlayer();        gui = new FXUI ( stage );        ...    }    public static void main ( String[] args ) {        launch( args ); //This calls start() above.     }}Now, when I need them, I can just call Hypnos.getPlayer(), or Hypnos.getGUI(), without having to pass a bunch of objects around through the various classes and methods. 
Singleton design for small/medium sized music player project
java;architecture;architectural patterns;javafx