Is MVVM pattern a symbiote of MVC + PAC patterns?

I've surfed Wikipedia and have found such an article:

http://en.wikipedia.org/wiki/MVC4WPF

A part from the link upper:

MVC4WPF is an open-source, extensible, automated code pattern developed at Information Control Corporation for Windows Presentation Foundation (WPF) development based on the Model-View-Controller (MVC) and Presentation-Abstraction-Control (PAC) patterns...

I know, that WPF/Silverlight do use MVVM pattern: Model-View-ViewModel.

So is MVC4WPF a first version of MVVM?

I don't know the history of WPF/Silverlight development well, but MVVM has always remind me some sort of MVC.

And if it's true, then MVVM = MVC + PAC ?


Whenever I see questions like this, I always think about Dr. WPF's design pattern.

It really doesn't matter what you want to call your separate concerns. You will hear a lot of WPF people talk about MVVM, but all it really boils down to is trying to keep your code separate. In MVVM, you have:

  • Model All your data classes. Knows nothing about anything.
  • View You gotta show your data. It knows about the Models, but not how to get them. "Knows" about the ViewModel through Bindings. Depending on how you wire them together, it may even create the ViewModel.
  • ViewModel This is the glue between the View and the Model. It can know about the View, or you can do your best to hide the view from the ViewModel.
  • In MVC you have:

  • Model All your data classes. Knows nothing about anything.
  • View You gotta show your data. Knows about Models, but not how to get them.
  • Controller This is the glue between the view and the model. It knows about the View and the Model.
  • Really, the last bit is all that changes (hence Dr. WPF's MV-poo). And in WPF, Bindings in XAML are so nice why would you want to write a bunch of code? Call it whatever you want, it is easier in WPF if the View knows a bit about the poo.

    Having never used the PAC pattern, I can't speak to its strengths, but from Wikipedia, it seems to be very similar to MVC. So, I would classify it as a bit of MV-poo.

    Now, considering that MVC4WPF hasn't had a release since 2009 (and their website with documentation is down as of 7/6/13), I would suggest you steer clear of it. I can't speak to its strengths or weaknesses, but if you'd like a good MVVM framework, MVVM Light and Caliburn.Micro both have good support and great reviews.

    I'd also point out that not all applications need the poo. Mike Hillberg put this nicely.

    链接地址: http://www.djcxy.com/p/63368.html

    上一篇: 比较MVVM WPF和MVC / MVVM AngularJS

    下一篇: MVVM模式是MVC + PAC模式的共生吗?