On the design mode of MVP and Model-view-viewmodel (MVVM)

Source: Internet
Author: User

Microsoft's WPF brings new technical experience, such as Sliverlight, audio, video, 3D, animation ..., which leads to more detail and customization of the software UI layer. At the same time, at the technical level, WPF has also brought

New features such as binding, Dependency property, Routed Events, Command, DataTemplate, ControlTemplate, etc. MVVM (Model-view-viewmodel) framework

The origin of this is a new architectural framework that evolves when the MVP (Model-view-presenter) model is combined with WPF. It is based on the original MVP framework and combines the new features of WPF

To address the increasingly complex needs of customers.

WPF data binding and presentation model collection are good practices that allow developers to separate view and logic, but this data binding technology is very simple and practical and is unique to WPF

, so we call it Model-view-viewmodel (MVVM). This pattern is similar to the classic MVP (Model-view-presenter) model, except that you need a custom-tailored

Model, this model is viewmodel. ViewModel contains all the UI-specific interfaces and attributes, and is bound by a ViewModel view, and can get loose coupling between the two, so

You need to write the appropriate code in the ViewModel direct update view. Data-binding systems also support validation of input that provides a standardized way to transmit validation errors to views.

The following figure is shown in the MVP design pattern schema.

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.