A popular technique used with GUI programs is a programming design called Model-View-Controller. This is a programming technique where you split your program up into three distinct portions - the model, view, and controller - and have each portion handle a single, separate function of the program. Model-View-Controller is not built in to any programming language, but is rather a method programmers use when designing their programs. The model handles the program's data. Whether it is a series of variables, some files, or a database, the model is responsible for managing and retrieving the data. The view, controller, and user never see or interact with the data directly; it all goes through the model. The view handles the presentation of the data. This would be the GUI design in a graphical program. The view does not retrieve the data, handle errors with the data, or manage user requests. The view's only purpose is to construct the visuals for whatever data is passed to it, regardless of what that data is. The controller works as the middleman between the model, view, and user. The controller consists of the traditional programming concepts we've learned so far, and manages all of the program's logic. Handling user input and requests, asking the model to fetch data, asking the view to format the output, and handling errors are all tasks given to the controller. Question: , find a real-world example of a program, app, or service that might use the model-view-controller pattern and explain how it might be split up into the three pieces of the design. You don't need to know how the program is actually implemented; the goal is to analyze professionally made programs to learn something about how they are (or aren't) well designed.
JAVA
A popular technique used with GUI programs is a
- The model handles the program's data. Whether it is a series of variables, some files, or a
database , the model is responsible for managing and retrieving the data. The view, controller, and user never see or interact with the data directly; it all goes through the model. - The view handles the presentation of the data. This would be the GUI design in a graphical program. The view does not retrieve the data, handle errors with the data, or manage user requests. The view's only purpose is to construct the visuals for whatever data is passed to it, regardless of what that data is.
- The controller works as the middleman between the model, view, and user. The controller consists of the traditional programming concepts we've learned so far, and manages all of the program's logic. Handling user input and requests, asking the model to fetch data, asking the view to format the output, and handling errors are all tasks given to the controller.
Question:
, find a real-world example of a program, app, or service that might use the model-view-controller pattern and explain how it might be split up into the three pieces of the design. You don't need to know how the program is actually implemented; the goal is to analyze professionally made programs to learn something about how they are (or aren't) well designed.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps