What is the difference between controller in MVC pattern and presenter in MVP pattern?

前端 未结 2 1345
故里飘歌
故里飘歌 2020-12-28 08:39

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

2条回答
  •  温柔的废话
    2020-12-28 09:42

    In MVP the Presenter assumes the functionality of the "middle-man" (played by the Application Controller in MVC). Additionally, the View is responsible for handling the UI events (like mouseDown, keyDown, etc), which used to be the Controller's job. Eventually, the Model becomes strictly a Domain Model.

    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.

提交回复
热议问题