Question

I'm pretty new to design patterns and need to implement an MVP architecture for a medium sized project I'm re-doing. I'm a little unclear on the discrepancies between the Presenter and the Model, however.

For example, I've got UserFile and VersionedFile (inherits from UserFile) as two different Models. Then I have a FilePresenter class.

Does the logic that actual manipulates the files belong in the Model, or the Presenter? For example, property validation or a method to copy the file from location to location.

I've read over the wiki article on MVP/MVC and some MSDN links as well, and I believe it should all belong in the Presenter. The Model should be "dumb" like the View-- it doesn't do anything but sit there and look pretty. Any and all work is done by the Presenter/Controller, right?

Hope this is objective enough to not be flagged as open-ended.

Was it helpful?

Solution

Does the logic that actual manipulates the files belong in the Model, or the Presenter? For example, property validation or a method to copy the file from location to location.

All of that belongs in the Presenter; which could also be called a Controller. The Model is simply built to get the data to the View.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top