开发者

Why do some people presents MVVP as an evolution/improvement over MVC whereas it is just some implementations? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this开发者_运维技巧 question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 12 years ago.

The usual myth around MVVP is that originally Marting Fowler did create a Pattern called MVP and then Grossman make it evolves into MVVP.

Did they read the original MVC paper carefully ? MVC was presented as concepts and for example it never imposes one single model it did say that model could be splitted in multiple smaller models depending on the way one wants to model the system. So if one wants to create a passive view or a fat view what counts is the two-way binding between many views and the model.

So I'm astonished to read articles pretending that MVVP is some new modern invention, and two-way databinding in wpf is a new revolution, for me the industry has rather been very slow to reify concepts that was setup 40 years ago. That's the very cause of so "software crisis" because fundamental concepts were badly implemented or even lacking and programmers were prisonners of the industry vendors.

So here's the original paper http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html

Show me what these "modern" pattern fundamentally contradicts MVC.


You need to do your homework! Martin Fowler is highly knowledgeable when it comes to UI patterns (and patterns in general). See his article on UI architectures:

http://martinfowler.com/eaaDev/uiArchs.html

Martin proposed a patten he called presentation model (PM) where the PM is a representation of the view which is independant of the UI controls in the view itself:

http://martinfowler.com/eaaDev/PresentationModel.html

He mentions how this pattern is easiest to implement with UI frameworks that pemrmit databinding, which reduces the need for 'plumbing' code.

Gossman first coined the term Model-View-ViewModel (MVVM), however most consider this to be the same pattern as PM, however, most consider MVVM to be a WPF / Silverlight specific version of PM, i.e. MVVM typically implies further conventions are followed, e.g. use of DataTemplates, ICommand, etc ...

Neither pattern are that similar to MVC, if you draw the dependencies to the three components of each pattern, MVC creates a triangle, whereas PM & MVVM are a line.

Most experienced developers take a pragmattic approach to patterns. They are a tool, pick the one that best fits your problem, and if you have to bend it a bit to make it fit, go for it.

Stop stressing - and write some code ;-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜