Can the presenter in Model-View-Presenter do non-UI actions/logic?
I am wondering if the Presenter in Model-View-Presenter is allowed to do logic/actions that are non-UI centric? Is MVP solely for UI and data or can I开发者_Python百科 use it for a project where I need to write to a file (via the controller / the presenter)?
What's actually the difference between the presenter and the controller?
Controller is usually associated with MVC pattern, Presenter always with MVP. There are so many flavors. Remember, goal of MVP is to allow for testing and to decouple dependencies. How you achieve it is up to you. I for example delegate all data related operation to DataService that is injected to Presenter. If you need some file writing, you better inject that service, otherwise, good luck with testing it...
精彩评论