Solved

MVC is screen part of Model or View?

Posted on 2014-02-16
2
293 Views
Last Modified: 2014-02-18
Model-View-Controller:

"Screen" sounds like it should be a part of the Model, as it's a physical tangible thingy. And the Screen display sounds like data, (the state of the pixels on the screen, (a screen has pixels,)) and doesn't data go in the Model?

Or, is "Screen" supposed to be a part of the View?
0
Comment
Question by:deleyd
2 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 100 total points
ID: 39863030
If you refer to the scren as where you are reading data, that's part of the view - see e.g. the graphics at http://en.wikipedia.org/wiki/Model-view-controller

What exactly do you mean by "screen"?
0
 
LVL 28

Accepted Solution

by:
pepr earned 400 total points
ID: 39864184
Always, when you think too much about any word, you start to ask questions that are kind of strange. Generally, the MVC pattern purpose is to separate internal program structure for getting the independence (i.e. losely coupled interfaces between the parts).

The Model should always be the part that does not depen on anything visible outside. Think about having the application, that can be executed without GUI, running automatically. Every input is captured in config data or it can be obtained automatically from somewhere. Think also in terms that you want to test the core functionality of your application automatically. It is very difficult when you add GUI as a user-behaviour dependent part -- the testing cannot be automated easily.

The View is about interpreting the content of the model. It can be displayed on the screen, exported to some file format, or only a part of the model data can be extracted to get simplified view, etc.

The Controler is the most complicated when speaking about GUI. Some parts of the controler are bound to GUI, some parts are not -- it depends on the solved problem. Touching a screen does not mean here to use the visibility of data (that is the part of View interpretation). It means only that some GUI elements have a different purpose -- to control the behaviour of the application, to get the *input* from the user.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question