简体   繁体   中英

Is MVC specific to Web application?

I might sound very naive here.

Does MVC applies only for Web application? I have worked on MVVM for quite some days and I see people telling MVVM with WPF is a windows version of MVC. What would be the alternate solution for MVC or MVVM as of now? Isn't any design patterns better than this discovered yet?

I am very specific to .NET here.

No. Mvc is not specific to web applications or .net.

All the mvx patterns have in common the view and the model. The view is concerned with the display of the data, the model delivers the data.

In mvc the data is pulled out of the model by the controller who puts it in the view. The user interactions where delegated from the view to the controller who acts on the model. View and Model does not now of each other.

With new technologies like data binding mvc becomes bulky. Mvp was introduced. It allows for the view to use data binding directly to the model, bypassing the controller who is now called presenter. The presenter orchestrates view and model but has fewer responsibilities.

Later mvp was replaced with mvvm. Here model and view are again completely separated and do not know each other. The Viewmodel is a model that is designed specific to the views needs. It also handles the responsibilities of the controller.

In my opinion the asp.mvc is not truly mvc. You hand out either objects of the model, or special desinged viewmodels to the razor views, so its either more mvp or mvvm with adding a controller to manage the other parts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM