It is currently Tue Dec 12, 2017 10:04 am

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Seperating Game model from Game Gui
PostPosted: Sun Dec 21, 2008 8:10 am 
Offline
Main Coder

Joined: Fri Apr 04, 2008 10:50 pm
Posts: 169
Separate model from gui
So when a button is added to the gui the model is not affected. or in other words when the gui is broken the model is not affected(and the other way around).
This helps in providing distinct packages gui and model for people to work in and keeps the gui classes clean.

But how will model and gui work together then I propose:
The gui registers for events from the model
When the model changes(any field) it sends an event to any listener(the gui)

What do you think...


Top
 Profile  
 
 Post subject: Re: Seperating Game model from Game Gui
PostPosted: Sun Dec 21, 2008 7:58 pm 
Offline
User avatar

Joined: Tue Oct 28, 2008 8:51 am
Posts: 121
It should go without saying that any modern program should be written with the knowledge of separation of concerns.
Model/view/controller is defacto, writing code that is not model view controller is like just trying to be difficult!
Modular, testable code is all I am interested in producing. What you are suggesting with event listeners triggering actions that in turn call the respective controllers and generate and affect the concerned models is the only way to go. We'll keep this in mind when creating new code for the game.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 9:30 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Blue Moon by Trent © 2007
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group