tags:

views:

75

answers:

1

Does ICommand implementation in MVP (Model - View - Presenter) belong in Presenter or its own class?

A: 

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.

Glenn Condron
Sorry, just realised this was for WPF and the commands I am talking about are probably not what you are talking about. I am thinking of a command pattern sending commands from the interface to the model. Custom command implementation that is, I have no real experience with WPF yet so no idea if the two ideas match.
Glenn Condron