The model in MVVM, can it be classes generated by Linq2SQL or EF or must it be domain classes?

Yes and no! The business layer & data layer of your application would consititute the MODEL as far as the MVVM pattern goes.

Yes and no! The business layer & data layer of your application would consititute the MODEL as far as the MVVM pattern goes. If your app is anything other than short lived and simple I would implement the MVVM model bit as two distinct layers; a business layer with the domain model and its corresponding data access layer.As a big fan of DDD (domain Driven Design) I would advocate a domain model that is as close to POCO (Plain old CLR Objects) as you can manage.

Use the Repository pattern to isolate those classes (which should effectivly be nothing but the application's business logic) from the nuts and bolts of data access. In the data access layer plonk all the EF or LINQ-to-SQL code. Data acess code in a data access layer, business logic in its own layer.

The two are different and deserve their own focused application layers IMHO.

For my own projects for example I use a Service Layer where I script all the things I need from the database. I get an entity and then I fill a new Domain Model with that entity.At my work however, there is no Domain Object other than the EF entities. – Garth Marenghi Apr 4 at 6:21 Sometimes yes you do.

If your database/services are yours you might get away without having to do that. When you have different DAL/BL classes then use the Adapter pattern to translate one class to/from the other to isolate that "grunt" code from any "proper" application logic to keep things easy to read – Pete Stensønes Apr 4 at 7:24.

If I understand MVVM correctly, the point of the pattern is that the ViewModel acts as a presenter between the Model and the View; it takes in a Model, and puts it / adapts it to a form that is understandable by a View. So in that frame, your model could be pretty much anything.

Its the classes generated by EF or Linq2SQL. The Domain Model is the collection of your entity models.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions