use Services in MVVM
I want to use Services(WCF/RIA /Web) to take data from Entity Data Model class (maybe NHibernate class) and prepared it special for View layer binding.
I have few Silverlight page, so should I create for each page separate s开发者_运维问答ervice class ? Or create one interface and all method will implement it in one service class?
Do You have some advice helped with my with services ?
I would go with a Service abstraction for the data access like done in the Repository Pattern. Have an Interface Like IDataService and then implement all the code containing the service there. It would be also possible to have one implementation for NHibernate, WCF Ria Service, Webservice.
Here is one example: http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=2807 here is another one: http://msmvps.com/blogs/theproblemsolver/archive/2009/02/18/getting-started-with-the-repository-pattern-in-silverlight.aspx
hope this helps..
精彩评论