SharePoint WebParts MVP Pattern
Can anyone explain how to implemen开发者_StackOverflow中文版t MVP pattern for SharePoint Webparts when you have user controls (with dropdowns) and webpart properties (or even more editorparts).
Thank you so much.
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.
精彩评论