mvvm - C# POCO to JS Object dynamically -


i looking @ mvvm knockout.js. 1 of things achieve "easily" code behind mvvm poco client corresponding js object.

the idea being that:

a) if change c# poco reflect in js object b) changing value in poco result in necessary interaction client update js object

i guessing when use signalr (http://signalr.net/) this? , use mapping plugin ko (http://knockoutjs.com/documentation/plugins-mapping.html) turn observables.

so questions are:

  1. are assumptions correct in terms of getting poco server side data ko via signalr
  2. is there way achieve 1.?

yes, can use signalr push real-time changes poco representation of object client. mean, won't automatic in terms of change property, magically sends message. have build plumbing ensure send specific signalr message when particular object changed. choose resend entire representation of object again (e.g. current values) or send values know changed more efficiency.

from there need update corresponding js representation of object which, if you're using knockout, result in proper notifications observers of said object. in other direction observing change on js object , sending message server.

obviously key each object must have kind of unique identity can correlate messages to/from proper js/poco objects.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -