MVC tutorials for MVP

拥有回忆 提交于 2020-01-07 05:33:34

问题


I'm new to MVP .

can I use tutorials created for asp.net MVC to learn MVP pattern foundations and basics? or differences are too much ?


回答1:


The 2 patterns are pretty different. The MVP pattern could be used with classic WebForms whereas ASP.NET MVC already integrates lots of the MVC pattern's parts in the framework itself. The separation of concerns is already present. If you want to use MVP with classic WebForms you will have much more work because the pattern is non-existent in the framework.




回答2:


MVC is good for plain server side scripting. In MVC developers always try to keep the controller very lean. Mainly controller is for just selecting the appropriate model and reflect on the view. But in today's web applications the View part has radically changed and became complex enough to produce a big, fat and messy controller. So now we need a new place to put the user interface's complex control logic. Here the P of MVP comes in that is the presenter. So presenters are responsible for controlling the logic for a particular user interface component. Don't worry the controller is still here, named as Application Controller. Which ultimately responsible for switching between comparatively larger application components. So MVP can also be said MVPC(!!). BTW this was my way of understanding MVP and obviously not any ground rule. But Google has some very cool documentations on MVP.



来源:https://stackoverflow.com/questions/10061451/mvc-tutorials-for-mvp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!