Will ViewModels fit into the View Presenter model?

Using ViewModels in MVC, I was wondering if applying this to the MVP pattern applies. I have only a few considerations, one of which is that MVP is already quite difficult to implement (with all the additional coding, not so much in apparent complexity) or that ViewModels already have a somewhat similar way of modeling data or objects. Will adding another layer in the form of ViewModels be redundant or is it a logical abstraction that I, as one implementing the MVP template, should adhere to?

+3
source share
2 answers

ViewModels can be very useful in MVP, and I think that add more benefits than the cost of extra coding.

I believe that the guiding rule is to use them where you need them, and not just add more templates or architecture for yourself.

I am working on a decent size with the asp.net web application, but for MVP in WinForms the following also applies. Below are the reasons why I found using VM in MVP.

The site aggregates data from boats of LOB web services. Services are supported by various development teams in different business verticals. The returned data is everywhere in terms of:

  • Soup type - saving the GUID as strings, returning dyads instead of decimals, dates as strings, etc.
  • - Camel, , jumbles

, , , MVC: . ..

, , :

  • ViewModels " ()"

, , () . , , . - AutoMapper .

+3

MVPVM, , . ( , , . , )

0

Source: https://habr.com/ru/post/1750239/


All Articles