-
February 2nd, 2009, 11:06 PM
#1
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!
-
February 3rd, 2009, 01:46 AM
#2
Re: OOP with GUI
Rate the posts which you find useful
-
February 3rd, 2009, 12:22 PM
#3
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
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
February 3rd, 2009, 09:09 PM
#4
Re: OOP with GUI
MVC answered my question. Thanks much. Thank you MOD-in-training ajbharani, but your 'assistance' was not required.
-
February 4th, 2009, 09:43 PM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|