Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC model-view-mapping

 
Skely Vengaboy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wishes to every one. This is my first posting to this great knowledge group.
I'm in the analysis stage of SCJD. While thinking of MVC architecture, I'm unable to decide on the followng:

The CONTROLLER must be aware of mapped between VIEW and MODEL. Should the mapping between view and model be hard coded or should it be externalized in a config file. I like the externalizing concept. Can we use XML config file like Struts-Config file. Which is a better way of doing.

I'm raising this question as I don't want to over do things than what is expected of our exam. What have our fore-fathers :-) done

Please give your suggestions. Have a wonderful day.

Thanks,
Skely
 
Kristof Janssens
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not allowed to use xml.

My mapping between model-view, model-controller, controller-view happens in the base class of my GUI application, so it's hardcoded.

What you suggest is beyond the scope, so don't need to worry about that I guess
 
Skely Vengaboy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestion Kristof.
I guess you are loading all the relationships as a Map and catching them in memory.

I believe your view passes a Key to the controller that suggests which Model to invoke for a particular action. After the Model has finished its execution, what determines which view must be shown next?

Model execution can end up either in a success scenario or a failure scenario. I want to show different views based on the scenario. I'm unable to decide who is responsible for determining which view must be displayed when...

Thanks,
Skely
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic