Learning ASP. net mvc Framework secrets note-View and Presenter interaction rules (for SC Mode), mvc-view

Source: Internet
Author: User

Learning ASP. net mvc Framework secrets note-View and Presenter interaction rules (for SC Mode), mvc-view
2. View and Presenter interaction rules (for SC Mode)

The interaction between View and Presenter is the core of the entire MVP. Whether the MVP mode can be correctly applied to construct our application depends on whether the relationship between View and Presenter can be correctly handled. In the triangular relationship composed of Model, Presenter, and View, the core element is not the View but the Presenter. The Presenter is not the intermediary for the View to call the Model, but the decision maker who finally decides how to respond to user interaction.

View can be understood as the customer proxy delegated by the Presenter to the front-end. The View as a proxy has no decision-making power, so it can only report the request to the principal Presenter.

For the process in which Presenter processes user interaction requests, if the intermediate stage involves a Model, it will directly initiate a call to the Model. If you need to participate in the View, Presenter will drive the View to complete the corresponding work.

View itself only implements independent UI logic. The data it processes should be pushed to it by Presenter in real time, so View does not maintain the data status as much as possible. It is recommended that the interface defined in IView only contain methods, but not attributes. The View status required by the Presenter should be obtained once upon receiving the user interaction request sent by the View, rather than through the View attribute.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.