views:

4889

answers:

5

The .NET RIA Services are described as an n-tier framework for Silverlight. I have been wondering what the relation is between this framework and the Model-View-ViewModel pattern. Are they in conflict or can you see the potential for synergic combination?

A: 

I would ask Jonas Follesoe. He seems to be interested in MVVM in SL.

http://jonas.follesoe.no/

Jonathan Parker
I will although I know that he is on Stackoverflow.
Przemek
+5  A: 

.NET RIA Services and MVVM are synergistic, and aren't in conflict.

For example, if I write a Catalog domain service that exposes Products and Categories on the server, and correspondingly have a Catalog domain context on the client... then the following are options to use depending on the scenario:

  1. Write a view model that wraps the Catalog domain context and exposes properties that hand out subsets of data that has been loaded into the Products and Categories lists. And expose operations that turn around and invoke methods on Catalog.

  2. Expose a Catalog out of the view model. Often this is perfect for read-only scenarios.

In either case your view model can take care of initializing the Catalog and customizing its creation, setup etc.

Hope that helps get you started in thinking how these might be effectively combined.

We'll definitely be showing some of this working in future samples we put out.

NikhilK
I really appreciate your response. Thanks.
Przemek
+1  A: 

BTW - Shawn Wildermuth has a nice succinct Silverlight MVVM article in the March 2009 issue of MSDN Magazine

Gordon Mackie JoanMiro
Hey, thanks for sharing this, although I don't think this article is so succint and also it does not touch on .NET RIA Services. Well, obviously it hit the 'press' before MIX09.
Przemek
Well - I personally found it succinct enough to read on the 30 minute commute into work...but there you go - just my opinion.
Gordon Mackie JoanMiro
+1  A: 

See http://msmvps.com/blogs/theproblemsolver/archive/2009/04/07/using-model-view-viewmodel-with-silverlight.aspx for an example.

Maurice
@Maurice With all due respect, I don't see any reference to .NER RIA Services in this blog entry which is otherwise a pretty good and informative one.
Przemek
Very true, I will do another blog post covering that. For now just think as the RIA entiry as the Model in my example.
Maurice
A: 

Dear All,

Is there an example of combining (implementing) .RIA service & the MVVM model.

Will be great to have .... Best regards

Waleed