-4

There are 3 layers: presentation, data, domain. MVP is an implementation of presentation layer, which itself consists of Model, View and Presenter. Please, describe the difference between Model and Data, Domain layers.

M. Maximovich
  • 189
  • 2
  • 12

1 Answers1

1

MVP is a pattern not an arquitecture itself, the model in MVP is the view model, meaning it should represent the data you dislay in the view, domain model is all the data that represents your application entities, in simple cases you will probably use the same domain model in the view but it's a good idea to separate both, keep your app logic in domain model, MVP will consume the data from domain model and add or transform presentation model for the view.

For example if you have a Users.geActiveUsers(), in a presenter you can get the list of active users and also have additional information in the model like "selectedUser" that doesn't belong to the domain model.

Look for "clean arquitecture" to know more about domain model and view model.

Nico
  • 993
  • 6
  • 7