In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the meaning of MVC model, view and controller". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the meaning of MVC model, view and controller"?
Model
Model, which represents knowledge. It can be either an object (of course, it doesn't make much sense if there is only one object), or it can be a structure made up of many objects.
The model and its components are one side, while the world to be represented in the consciousness of the model creator is the other side, and the two parties should correspond one by one. Naturally, each node of the model should explicitly correspond to a part of the problem.
All nodes in the model should solve the problem to the same extent, mixing problem-oriented nodes (for example, adding dating activities to the calendar) with implementation details (for example, showing in paragraphs) is not easy to understand. is something that should be avoided.
View
The view is the (visible) representation of the model. Views usually highlight some properties of the model while hiding others. In this sense, the view is like a presentation filter.
The view depends on the model (or part of the model) and obtains the necessary data from the model for presentation by asking questions. The view can also update the model by sending the appropriate message. These questions and messages are communicated according to the terminology of the model, so that the view must know the model it is representing and the semantics of its properties. (for example, the view may ask for the identifier of the model and expect to return an instance of Text, but it may not think that the model is a Text class.)
Controller
The controller is the link between the user and the system. It provides input to the user, that is, it displays the relevant view in the appropriate location on the screen (for the user to browse). It provides the user with the means of output, that is, it shows the user menus and other controls that can accept commands and data. The controller receives the above user output, converts it into appropriate messages, and then passes these messages to one or more views.
The controller should not be used as a view, for example, you cannot use the controller to draw arrows to connect the nodes of the view.
On the other hand, views should not care about user input, such as mouse actions or keystrokes. In any case, you should be able to write a method in the controller that sends the message to the view in order to reproduce the user's command as it is.
Editor
The controller is responsible for connecting all of its views, which are part of the controller. Some views provide a special controller called editor so that users can modify the information represented by the view. This editor can be attached to the path between the controller and its view, similar to the extension of the controller. After editing, the editor is removed from the path and discarded.
Note that the editor communicates with the user through the specific representation of the relevant view, so the editor is closely related to the view. The controller learns of the existence of the editor by asking the view, but there is no other appropriate source of information.
At this point, I believe you have a deeper understanding of "what is the meaning of MVC model, view and controller". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.