M. Maximovich M. Maximovich - 4 years ago 77
Android Question

architecture layers and MVP in android

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download