Icommand in MVP
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.
精彩评论