MVVM / MVC [英] MVVM/MVC

查看:57
本文介绍了MVVM / MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于   ; survey
进行了
,我们看到   < span style ="color:#333333; font-family:arial,sans-serif; font-size:16px; line-height:normal; background-color:#f5f5f5"> more
and more  
应用程序开发中
 
后跟
  MVVM  
的优点是什么
 
这个关系
 
MVC
  因为
我们
更多
熟悉
  MVC   模型 - 视图 -Controller



我很欣赏   你的   意见,

For the survey conducted, we see that more and more in applications development, is followed by the MVVM, what are the advantages of this in relation to MVC, since we aremore familiar with MVC (Model-View-Controller)?

I appreciate your opinion,

问候,

Catia Dias

Catia Dias

推荐答案

MVVM优于MVC的优势 -

Advantages of MVVM over MVC -

1.增加视图的"可混合性"(使用Expression Blend设计视图的能力) - 这样做对有幸拥有设计师和程序员的团队的责任分离......每个人都可以独立于另一个人工作。

1. Increases the "Blendability" of your views (ability to use Expression Blend to design views) – This enables a separation of responsibilities on teams that are lucky enough to have a designer and a programmer... each can work independent of the other.

2."Lookless"视图逻辑 - 视图与在其后面运行的代码无关,使得相同的视图逻辑可以在多个视图中重用,或者可以轻松地重新组合或替换视图。分离"行为"和"样式"之间的关注。

2. "Lookless" view logic – Views are agnostic from the code that runs behind them, enabling the same view logic to be reused across multiple views or have a view easily retooled or replaced. Seperates concerns between "behavior" and "style".

3.没有重复的代码来更新视图 - 在代码隐藏中你会看到很多调用更新视图控件。使用MVVM你可以确保视图只是通过适当的更新设置基础属性和所有查看其副作用。

3. No duplicated code to update views – In code-behind you will see a lot of calls to update view controls. With MVVM you can be assured the view is updated appropriately just by setting the underlying property and all view side-effects thereof.

4。可测试性 - 由于您的逻辑与您的视图完全无关,因此单元测试变得简单。您可以在不涉及其视图的情况下测试ViewModel的行为。这也启用了测试驱动的视图行为开发,使用代码隐藏几乎是不可能的

4. Testability – Since your logic is completely agnostic of your view, unit testing is made easy. You can test the behavior of a ViewModel without involving its view. This also enabled test-driven development of view behavior, which is almost impossible using code-behind.

5。 Designer-Developer工作流程 - MVVM有助于将UI和表示逻辑问题从业务层分离出来,通过允许设计周期与开发并行发生,可以轻松简化开发过程。

5. Designer-Developer Workflow – MVVM facilitates a separation of UI and presentation logic concerns from the business layer that makes it easy to streamline the development process by allowing design cycles to happen in parallel with development.

这篇关于MVVM / MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆