MVP: Should the View implement a Presenter's interface or vice versa?

前端 未结 3 852
离开以前
离开以前 2020-12-14 03:25

I am doing my first steps with GWT. I have a question after reading:

  • Large scale application development and MVP
  • Large scale application
3条回答
  •  Happy的楠姐
    2020-12-14 04:21

    @deepak these are valid concerns . Word is infect implementation not definition .

    Let me explain . In first example presenters hold the contract to what view must implement in other words drives what should be implemented by views a classical MVP approach .

    Things get confusing in second example. Where Presenter has no control over what view must implement . This is not MVP and google is calling it as MVP . There is no way you can test the views with JRE /unit tests using this approach . That does not make it bad though just not MVP and google should not call this MVP or they must explain as to why is it an MVP ?

    @Saket Bansal separating out interface is not correct approach . It will result in hard to maintain code as application grows .

    In my opinion you can take either approach , I remember google saying some where first one worked for them for adwords and second for wave .

    Any how you should also look at framworks like GWTP or ERRAI from jboss

提交回复
热议问题