views:

85

answers:

1

Where in this pattern I can "place" services, about which I some much hear and want use? What is the purpose of use Services (WCF) in MVVM ?

Which of services: Web Services, WCF or RIA is the best and the easiest for MVVM? I only read about realy simple WCF contracts and RIA which have from start create Update,Insert etc method...

+2  A: 

Model-View-ViewModel is a UI separation pattern. It does not specifically address the role of services in your application. But in general, your "Model" will likely have persistence needs that will need to cross out of the UI layer into a service layer and WCF provides a good transport for that.

Using a dependency injection framework (which is common in MVVM) you can register your WCF service interfaces with the container so that you can work with interfaces instead of directly with the WCF client proxies.

With regard to WCF data services vs. RIA services, I don't know the jury is still out on that. WCF data services is released, RIA services is not. RIA does tend to blur the lines between what is client and what is server. This can be both good and bad. It solves a lot of problems with duplicated validation rules and such but I personally get a little nervous about such tight coupling of the client and server.

Josh Einstein
I don't understand what pros i have in put UI into service?About WCF vs RIA... WCF looks clearly for me, it have interface and implementing class, RIA have too much stuff in his project :/ But it's only opinion of beginner of services...In other Your replay... I honestrly don't understand :( I must read more about registering WCF and WCF at all ...
netmajor