netmajor
netmajor

Reputation: 6585

Model responsibilities in MVVM

Is Model only Entity Data Model class of my database? Model as simple place where i have my data? Or I can input in Model something more?

Upvotes: 1

Views: 554

Answers (3)

kyoryu
kyoryu

Reputation: 13055

The model is the core domain logic you are dealing with. It is everything not directly related to a UI view.

An easy way to think of it is the View and ViewModel combined represent what would be a "typical" UI layer without good separation. In MVVM, you split the logical aspects (the ViewModel) from the display logic (the View).

Upvotes: 1

Dean Harding
Dean Harding

Reputation: 72648

You can do whatever you like...

Typically, though, the "model" in MVVM is considered to be an "external" class (e.g. a generated class from LINQ-to-Entities, say) and so it usually doesn't have much logic.

Upvotes: 1

Michael Sondergaard
Michael Sondergaard

Reputation: 1494

The model in MVVM is supposed to be the place for data-centric logic and the data, yes. It can be just the Entity Data Model, or you can add some more logic--that's up to you. The primary point is to seperate any presentation-specific logic from the model and put that in the viewmodel.

Hope that's clear enough

Upvotes: 3

Related Questions