开发者

The Model in MVP - Events

I have a layered architecture as开发者_如何学运维 follows;

Presentation

Service

Business

Data

If I implement MVP for the presentation my understanding is that the Service Layer represents the 'M' i.e. model, is my understanding correct? If so from my interpretation of MVP the model can raise events which my presenters would subscribe to. Does this mean that my service layer would raise events?

UPDATED

This question has been viewed a number of times but has not attracted any comments or answers, if there is something wrong with the question please comment as I would like to get an answer on this. Thanks.


The basic idea behind the View Presenter portion of a MVP design is that view is lightweight. Much of the logic that folks put into the form and controls reside in the Presenter. The Presenter is the grand central station of the design. Retrieving the data, updating the model, and raising events to let the other areas of the application know that something has changed. The model is mostly focuses on the storage and retrieval of the desired data.

The key question in using MVP design is what happens if I rip off Forms X and replace it with Forms Y? If you find yourself making radical changes to the presenter to reflect the new UI then likely it not a clean MVP design.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜