开发者

Icommand in MVP

开发者 https://www.devze.com 2022-12-22 18:16 出处:网络
Does ICommand implementation in MVP (Model - View - Presenter) belong in Presenter or its ownclass开发者_如何学Go?You are talking about a custom MVP setup correct? Not some form of framework?

Does ICommand implementation in MVP (Model - View - Presenter) belong in Presenter or its own class开发者_如何学Go?


You are talking about a custom MVP setup correct? Not some form of framework?

My feeling is that any commands should be in their own class.

My reasoning for this comes from an experience I had where we built a win forms app using the MVP pattern. In this project we built a simple app and later needed to develop another application that contained almost all of the same functionality, plus more. So we re-used the model for the simpler app but did not re-use any of the presenters or views.

Commands being in their own class means that you can do something like the above and keep using the icommand implementations relatively easily.

0

精彩评论

暂无评论...
验证码 换一张
取 消