Suppose one is working on a game which has more than one component of code where the data, view, and logic is disjoint from the workings of another component of code (i.e. all games have a main menu and the game itself, with their looks, logic, and data being independent). How best should one lay an application out?
I see at least two options:
- Top-level code creates model, view, and controller objects which then each have fields of each area of the application. For example, the model object may have a menuData field and a gameData field. Each of the view and controller would also have something similar. Additionally, the main controller would have access to the main view and main model.
- Top-level code creates an object for each area of the code (i.e. menu and game), and then each of these has their own model, view, and controller.
Are either of these the best way to go about this? Is there a more common approach than MVC?