What is the difference between controller in MVC pattern and presenter in MVP pattern? Can you provide links for understanding the Merits and usage scenario for both of them?
相关问题
- How to dynamically load partial view Via jquery aj
- Name for a method that has only side effects
- What is a correct approach to manage test data usi
- Can a [GoF]-ConcreteSubject override the notify me
- Can the builder pattern ever be doing too much?
相关文章
- Forward request from servlet to jsp
- superclass mismatch for class CommentsController (
- play2 framework my template is not seen. : package
- Builders in Java versus C++?
- “Adapter” or “adaptor”?
- Is copy-and-paste coding ever acceptable?
- How to catch exception in flutter?
- How to Create a Custom tabBarController to simulat
Says Wikipedia.
Here is a more detailed explanation on the differences between the two.
See also Martin Fowler's Retirement note for Model View Presenter.
In MVC, the view is updated only by the model (by listening to its events). It is never updated by the controller. This is problematic when you need to format model data for the view, hence the need for MVP.
In MVP-Passive View, the view is updated only by presenter (presenter sets view properties). The presenter listens to events on the model [modifying the data if required] prior to updating the view.
In MVP-Supervising Controller, the view is updated by either the model or the presenter. If no formatting is required, the view updates itself via the model. If formatting is required, it updates itself via the presenter.