Say you have an ASP.NET MVC project and are using a service layer, such as in this contact manager tutorial on the asp.net site: http://www.asp.net/mvc/tutorials/iteration-
Hi I see very good answers here. And for myself I do an other aproach. I have to kinds of models , one is viewmodel and the other is shared models. The viewmodels stays on the UI layer and the shared models stays on a separate project. The shared models can theoretically be used anyware because those are standalone. This models provides some abstraction if you want to return specific data from your service layer or if you need something specific from your repository. I don't really know if this is a good aproach but it works so well on my projects. For example When I need to provide some information to create new objects to the database i can use the shared models directly to the service layer it saves me some complexity. The shared models needs to be mapped sometimes , but you can ensure that your service is not leaking inesssary data to the UI. You can see shared models as an extension but not to build your UI logic with it, you should have viewmodels to do that. You can combine viewmodels with this shared models to save you time you can use inheritance. The shared models has to be neutral and should not have any kind of logic.