Reputation: 3609
Would I be correct in thinking that the 'Model' represented by the M in MVP could be a domain model or a presentation/view model?
Upvotes: 3
Views: 1022
Reputation: 233125
Yes, the Model could be essentially any Model. The way I see it, the original intention of MVC was that it is a Domain Object, and that is certainly still possible.
However, my experience have shown that a better fit is achieved if we introduce a specialized ViewModel/Presentation Model as a insulation between the Domain Model and the View.
Even when the ViewModel seems to be semantically identical to the Domain Object, such an insulation enables us to vary the two independently and thus follow the Single Responsibility Principle.
It often turns out that the View needs some logic that applies to the specific UI technology, and this logic fits badly in the Domain Model. Examples include
More information can be found here
Upvotes: 7