I have two classes: GUI and Game, which handle the GUI logic and the game logic respectively.
Should I make an instance of GUI in Game, or an instance of Game in GUI.
If it makes any difference: it’s Java.
Some more explanation:
I’m making a game of life clone in Java, but I’m running into some issues with updating my GUI. Before continuing to solve those issues, I want to know what the proper way is to use a GUI.
Neither.
I would recommend you to build your application following the Model-View-Controller idiom.
The game state (model) and the visual representation of it (view) should not depend on each other. Both should be created and manipulated by a controller (or multiple controllers).
This application design has the advantage that you can easily make changes to one of the components (or even replace them completely) without having to touch the other.