开发者

"Presenter First" vs "Passive View" MVP?

Is the "Presenter First"开发者_C百科 MVP pattern the same as the "Passive View"? If not, how do they differ?


Maybe i'm wrong, but from what i understand :

The mvp pattern used in presenter first approach is a slight variation around the passive view described by martin fowler. In some case, when the business object (or model) is too hard to map directly on the view, they use an adapter class between the presenter and the view. The adapter is responsible for translating a complex object into some trivial types used by the dumb final view.

Ex: The presenter have to deal with a PersonList model. The view is made of a grid. The Presenter pass the model object directly to the adapter (that take the role of the view) and the adapter translate it into cells, rows, columns and vice versa.

For a very simple object to map on a view, i think it's a pure passive view MVP pattern like fowler's one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜