What are the differences between Presenter, Presentation Model, ViewModel and Controller?

前端 未结 6 1761
臣服心动
臣服心动 2020-12-22 19:16

I have a pretty good idea how each of these patterns work and know about some of the minor differences between them, but are they really all that different from each other?<

6条回答
  •  無奈伤痛
    2020-12-22 19:48

    One important distinction between MVP and MVVM is that VM can be used with many views, MVP is usually 1-1 between Presenter and View with a contract interface that enforces its methods. Android has done much to incorporate MVVM with the ViewModel component that is built on top of a retained Fragment. It is the pattern of choice for Architecture and well suited for any app.

提交回复
热议问题