SharePoint WebParts MVP Pattern

限于喜欢 提交于 2019-12-25 03:21:33

问题


Can anyone explain how to implement MVP pattern for SharePoint Webparts when you have user controls (with dropdowns) and webpart properties (or even more editorparts).

Thank you so much.


回答1:


Treat the webpart controls and the webpart properties (including the data they store) as view code. You really don't want to persist any domain model information inside the webpart properties. This makes it easier to create a presenter interface the both the webpart property and webpart control views can call to retrieve domain model information.

Create a decent factory to get an instance of the presenter and your code should be nicely separated.



来源:https://stackoverflow.com/questions/6801592/sharepoint-webparts-mvp-pattern

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