MVVM, REST and AsyncModels

I feel like MVVM and REST, taken together, can create a solid and reliable model for programming over the years. (My intuition tells me that we MUST consider them together.) It also appears that this should be the correct abstraction for asynchronous operations in ViewModels and Controllers - as a compound plot of asynchronous data (with transaction support) - a thing that works at a higher level of abstraction than C # 4.0 parallels (closer to the logic of business processes ),

Are there any investigations or recommendations regarding this?

  • MVVM + REST -?
  • MVVM + AsyncModels -?
  • REST + AsyncModels -?
  • MVVM + REST + AsyncModels -?
+2


source to share


2 answers


I totally agree with you that MVVM + Rest together is the perfect combination.

Maybe the problem with getting more interest is that its natural target is Silverlight applications, and the frameworks they promote are RIA services.

I personally prefer to fetch data from Rest server and have MVVM Model objects corresponding to Rest resources.



I don't know of any research on this, but it's an interesting topic. On asynchronous operations, I would suggest using IEnumerable based hoops. I know of 2 frameworks that use this:

1) caliburn

2) Dream Rest framework , but (for which I know) is not silvery.

0


source


I'm afraid your question is a little vague to give a really clear answer, but I'll 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 I think this is a very viable approach as you are considering the model as the return media type from the Http request.
If you are talking about implementing RESTful endpoints using MVVM, then I prefer the straightforward MVC pattern.



I'm really not sure what you are asking regarding AsyncModels. Are you assuming that the model loads its data asynchronously from REST endpoints? Are these "asyncmodels" a replacement for M in MVVM or are they optional.

It would be much easier to give you the correct answer if you could tell me at what physical level you expect these various components to run.

+1


source







All Articles