-
OOP with GUI
How do I organize a program with at least a GUI, an AI, and a driver file? I need to design a checkers program. I really just need to know how to organize it so its OOP(meaning what extends what, and how do I pass the updated board if the human player clicks it to the AI, and whatnot)
Thanks!
-
Re: OOP with GUI
-
Re: OOP with GUI
You might try searching for the MVC (Model, View, Controller) pattern. The View would be the GUI itself, the model would be the data concerning the board grid and piece values and positions, and the controller would co-ordinate activities, getting moves from player or AI, applying them to the model, and optionally refreshing the view from the model (this could be automatic if the view is listening to or observing changes in the model).
There can be MVC patterns at various levels, from application level down to individual GUI components - for example, Swing uses MVC for GUI components.
All truths are easy to understand once they are discovered; the point is to discover them...
G. Galilie
-
Re: OOP with GUI
MVC answered my question. Thanks much. Thank you MOD-in-training ajbharani, but your 'assistance' was not required.
-
Re: OOP with GUI
Though ajbharani has a valid point: the more specific the question, the greater the chances of getting a specific and helpful answer. YMMV.