tags:

views:

113

answers:

2

Hi! I feel, that MVVM and REST being considered together can produce a solid and reliable pattern for programming for many years. (My intuition says me that we SHOULD consider them together). Also it seems that it should be a proper abstraction for Asynchronous operations in ViewModels and Controllers - like a composable asynchronous data dependency graph (with support of transactions) - thing that operates at higher level of abstraction than c# 4.0 parallels (closer to busines logic).

Are there any investigations, or best practices on that?

  1. MVVM + REST - ?
  2. MVVM + AsyncModels - ?
  3. REST + AsyncModels - ?
  4. MVVM + REST + AsyncModels - ?
A: 

I'm afraid your question is a little vague to give a really clear answer, but I will give you my thoughts.

If you are talking about using MVVM on the desktop (or JS in the browser) and REST on the server then then I think this is a very viable approach, as long you consider the Model as the media-type that is returned from the Http request.
If you are talking about implementing RESTful endpoints using MVVM then I tend to prefer a straight MVC pattern.

I'm really not sure what you are asking with regards to AsyncModels. Are you inferring that the model asynchronously load their own data from REST endpoints? Are these "asyncmodels" a replacement for the M in MVVM or are they in addition.

It would be much easier to give you a valid answer if you could tell me on which physical tier you expect these various components to run.

Darrel Miller
A: 

I completely agree with you in that MVVM + Rest together are a perfect combination.

Maybe the problem for this to get more interest is that his natural target are Silverlight applications, and the framework they are promoting there is RIA Services.

I personally prefer to get data from a Rest server, and to have my MVVM Model objects correspond to Rest resources.

I don't know any investigations about this, but sure is an interesting topic. About the async operations i would suggest using couroutines, based in IEnumerable. I know 2 frameworks that use that:

1) caliburn

2) the Dream Rest framework, but (for what i know) is not silverlight.

DaniCE